<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-record-updates #-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Rename.Splice</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-8"></span><span>        </span><span class="annot"><a href="GHC.Rename.Splice.html#rnTopSpliceDecls"><span class="hs-identifier">rnTopSpliceDecls</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-9"></span><span>        </span><span class="annot"><a href="GHC.Rename.Splice.html#rnSpliceType"><span class="hs-identifier">rnSpliceType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Splice.html#rnSpliceExpr"><span class="hs-identifier">rnSpliceExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Splice.html#rnSplicePat"><span class="hs-identifier">rnSplicePat</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Splice.html#rnSpliceDecl"><span class="hs-identifier">rnSpliceDecl</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.Rename.Splice.html#rnBracket"><span class="hs-identifier">rnBracket</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.Rename.Splice.html#checkThLocalName"><span class="hs-identifier">checkThLocalName</span></a></span><span>
</span><span id="line-12"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Splice.html#traceSplice"><span class="hs-identifier">traceSplice</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Splice.html#SpliceInfo"><span class="hs-identifier">SpliceInfo</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span>
</span><span id="line-13"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-20"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html"><span class="hs-identifier">GHC.Types.Name.Set</span></a></span><span>
</span><span id="line-21"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.Reader.html"><span class="hs-identifier">GHC.Types.Name.Reader</span></a></span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Monad.html"><span class="hs-identifier">GHC.Tc.Utils.Monad</span></a></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Env.html"><span class="hs-identifier">GHC.Rename.Env</span></a></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html"><span class="hs-identifier">GHC.Rename.Utils</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#HsDocContext"><span class="hs-identifier">HsDocContext</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier">newLocalBndrRn</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Unbound.html"><span class="hs-identifier">GHC.Rename.Unbound</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier">isUnboundName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Module.html"><span class="hs-identifier">GHC.Rename.Module</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Module.html#rnSrcDecls"><span class="hs-identifier">rnSrcDecls</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Rename.Module.html#findSplice"><span class="hs-identifier">findSplice</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.Pat.html"><span class="hs-identifier">GHC.Rename.Pat</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Pat.html#rnPat"><span class="hs-identifier">rnPat</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier">TopLevelFlag</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#isTopLevel"><span class="hs-identifier">isTopLevel</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#SourceText"><span class="hs-identifier">SourceText</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Rename.HsType.html"><span class="hs-identifier">GHC.Rename.HsType</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.HsType.html#rnLHsType"><span class="hs-identifier">rnLHsType</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-35"></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier">unless</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier">when</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Rename.Expr.html"><span class="hs-identifier">GHC.Rename.Expr</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier">rnLExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-39"></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html#checkWellStaged"><span class="hs-identifier">checkWellStaged</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html"><span class="hs-identifier">GHC.Builtin.Names.TH</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#liftName"><span class="hs-identifier">liftName</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#dumpIfSet_dyn_printer"><span class="hs-identifier">dumpIfSet_dyn_printer</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier">DumpFormat</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html"><span class="hs-identifier">GHC.Tc.Utils.Env</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Env.html#tcMetaTy"><span class="hs-identifier">tcMetaTy</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Hooks.html"><span class="hs-identifier">GHC.Driver.Hooks</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html"><span class="hs-identifier">GHC.Builtin.Names.TH</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#quoteExpName"><span class="hs-identifier">quoteExpName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#quotePatName"><span class="hs-identifier">quotePatName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#quoteDecName"><span class="hs-identifier">quoteDecName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#quoteTypeName"><span class="hs-identifier">quoteTypeName</span></a></span><span>
</span><span id="line-49"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#decsQTyConName"><span class="hs-identifier">decsQTyConName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#expQTyConName"><span class="hs-identifier">expQTyConName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#patQTyConName"><span class="hs-identifier">patQTyConName</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.TH.html#typeQTyConName"><span class="hs-identifier">typeQTyConName</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html"><span class="hs-identifier">GHC.Tc.Gen.Expr</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier">tcCheckPolyExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Splice.html"><span class="hs-identifier">GHC.Tc.Gen.Splice</span></a></span><span>
</span><span id="line-53"></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Splice.html#runMetaD"><span class="hs-identifier">runMetaD</span></a></span><span>
</span><span id="line-54"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Splice.html#runMetaE"><span class="hs-identifier">runMetaE</span></a></span><span>
</span><span id="line-55"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Splice.html#runMetaP"><span class="hs-identifier">runMetaP</span></a></span><span>
</span><span id="line-56"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Splice.html#runMetaT"><span class="hs-identifier">runMetaT</span></a></span><span>
</span><span id="line-57"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Tc.Gen.Splice.html#tcTopSpliceExpr"><span class="hs-identifier">tcTopSpliceExpr</span></a></span><span>
</span><span id="line-58"></span><span>    </span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.Zonk.html"><span class="hs-identifier">GHC.Tc.Utils.Zonk</span></a></span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#"><span class="hs-identifier">GHCi.RemoteTypes</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignRef"><span class="hs-identifier">ForeignRef</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.html#"><span class="hs-identifier">Language.Haskell.TH</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">TH</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#Q"><span class="hs-identifier">Q</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-64"></span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
        Template Haskell brackets
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnBracket"><span class="hs-identifier hs-type">rnBracket</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsBracket"><span class="hs-identifier hs-type">HsBracket</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span id="rnBracket"><span class="annot"><span class="annottext">rnBracket :: HsExpr GhcPs
-&gt; HsBracket GhcPs -&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnBracket"><span class="hs-identifier hs-var hs-var">rnBracket</span></a></span></span><span> </span><span id="local-6989586621681127368"><span class="annot"><span class="annottext">HsExpr GhcPs
</span><a href="#local-6989586621681127368"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span id="local-6989586621681127367"><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127367"><span class="hs-identifier hs-var">br_body</span></a></span></span><span>
</span><span id="line-77"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBracket GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#quotationCtxtDoc"><span class="hs-identifier hs-var">quotationCtxtDoc</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127367"><span class="hs-identifier hs-var">br_body</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(RnM (HsExpr (GhcPass 'Renamed), Uses)
 -&gt; RnM (HsExpr (GhcPass 'Renamed), Uses))
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-78"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- Check that -XTemplateHaskellQuotes is enabled and available</span><span>
</span><span id="line-79"></span><span>         </span><span id="local-6989586621681127364"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127364"><span class="hs-identifier hs-var">thQuotesEnabled</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#TemplateHaskellQuotes"><span class="hs-identifier hs-var">LangExt.TemplateHaskellQuotes</span></a></span><span>
</span><span id="line-80"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127364"><span class="hs-identifier hs-var">thQuotesEnabled</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-81"></span><span>           </span><span class="annot"><span class="annottext">MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a. MsgDoc -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#failWith"><span class="hs-identifier hs-var">failWith</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-82"></span><span>                      </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Syntax error on&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcPs
</span><a href="#local-6989586621681127368"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-83"></span><span>                      </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Perhaps you intended to use TemplateHaskell&quot;</span></span><span>
</span><span id="line-84"></span><span>                              </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot; or TemplateHaskellQuotes&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-85"></span><span>
</span><span id="line-86"></span><span>         </span><span class="hs-comment">-- Check for nested brackets</span><span>
</span><span id="line-87"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127356"><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127356"><span class="hs-identifier hs-var">cur_stage</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM ThStage
</span><a href="GHC.Tc.Utils.Monad.html#getStage"><span class="hs-identifier hs-var">getStage</span></a></span><span>
</span><span id="line-88"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127356"><span class="hs-identifier hs-var">cur_stage</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-89"></span><span>           </span><span class="hs-special">{</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#Splice"><span class="hs-identifier hs-type">Splice</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceType
</span><a href="GHC.Tc.Types.html#Typed"><span class="hs-identifier hs-var">Typed</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBracket GhcPs -&gt; Bool
forall id. HsBracket id -&gt; Bool
</span><a href="GHC.Hs.Expr.html#isTypedBracket"><span class="hs-identifier hs-var">isTypedBracket</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127367"><span class="hs-identifier hs-var">br_body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span>                                       </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalUntypedBracket"><span class="hs-identifier hs-var">illegalUntypedBracket</span></a></span><span>
</span><span id="line-91"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#Splice"><span class="hs-identifier hs-type">Splice</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceType
</span><a href="GHC.Tc.Types.html#Untyped"><span class="hs-identifier hs-var">Untyped</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBracket GhcPs -&gt; Bool
forall id. HsBracket id -&gt; Bool
</span><a href="GHC.Hs.Expr.html#isTypedBracket"><span class="hs-identifier hs-var">isTypedBracket</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127367"><span class="hs-identifier hs-var">br_body</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-92"></span><span>                                       </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalTypedBracket"><span class="hs-identifier hs-var">illegalTypedBracket</span></a></span><span>
</span><span id="line-93"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RunSplice"><span class="hs-identifier hs-type">RunSplice</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef [ForeignRef (Q ())]
</span><span class="hs-identifier">_</span></span><span>    </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-94"></span><span>               </span><span class="hs-comment">-- See Note [RunSplice ThLevel] in GHC.Tc.Types.</span><span>
</span><span id="line-95"></span><span>               </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnBracket: Renaming bracket when running a splice&quot;</span></span><span>
</span><span id="line-96"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsExpr GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr GhcPs
</span><a href="#local-6989586621681127368"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-97"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="GHC.Tc.Types.html#Comp"><span class="hs-identifier hs-var">Comp</span></a></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-98"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#Brack"><span class="hs-identifier hs-type">Brack</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a. MsgDoc -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#failWithTc"><span class="hs-identifier hs-var">failWithTc</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalBracket"><span class="hs-identifier hs-var">illegalBracket</span></a></span><span>
</span><span id="line-99"></span><span>           </span><span class="hs-special">}</span><span>
</span><span id="line-100"></span><span>
</span><span id="line-101"></span><span>         </span><span class="hs-comment">-- Brackets are desugared to code that mentions the TH package</span><span>
</span><span id="line-102"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#recordThUse"><span class="hs-identifier hs-var">recordThUse</span></a></span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs -&gt; Bool
forall id. HsBracket id -&gt; Bool
</span><a href="GHC.Hs.Expr.html#isTypedBracket"><span class="hs-identifier hs-var">isTypedBracket</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127367"><span class="hs-identifier hs-var">br_body</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-105"></span><span>            </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Renaming typed TH bracket&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-106"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127337"><span class="annot"><span class="annottext">HsBracket (GhcPass 'Renamed)
</span><a href="#local-6989586621681127337"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127336"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127336"><span class="hs-identifier hs-var">fvs_e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-107"></span><span>                          </span><span class="annot"><span class="annottext">ThStage
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a. ThStage -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#setStage"><span class="hs-identifier hs-var">setStage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ThStage -&gt; PendingStuff -&gt; ThStage
</span><a href="GHC.Tc.Types.html#Brack"><span class="hs-identifier hs-var">Brack</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127356"><span class="hs-identifier hs-var">cur_stage</span></a></span><span> </span><span class="annot"><span class="annottext">PendingStuff
</span><a href="GHC.Tc.Types.html#RnPendingTyped"><span class="hs-identifier hs-var">RnPendingTyped</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (HsBracket (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses))
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-108"></span><span>                                   </span><span class="annot"><span class="annottext">ThStage
-&gt; HsBracket GhcPs -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127356"><span class="hs-identifier hs-var">cur_stage</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127367"><span class="hs-identifier hs-var">br_body</span></a></span><span>
</span><span id="line-109"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed), Uses)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XBracket (GhcPass 'Renamed)
-&gt; HsBracket (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XBracket p -&gt; HsBracket p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsBracket"><span class="hs-identifier hs-var">HsBracket</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XBracket (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket (GhcPass 'Renamed)
</span><a href="#local-6989586621681127337"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127336"><span class="hs-identifier hs-var">fvs_e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-110"></span><span>
</span><span id="line-111"></span><span>            </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Renaming untyped TH bracket&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-112"></span><span>                        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127330"><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681127330"><span class="hs-identifier hs-var">ps_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[PendingRnSplice]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) (IORef [PendingRnSplice])
forall a env. a -&gt; IOEnv env (IORef a)
</span><a href="GHC.Data.IOEnv.html#newMutVar"><span class="hs-identifier hs-var">newMutVar</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-113"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127328"><span class="annot"><span class="annottext">HsBracket (GhcPass 'Renamed)
</span><a href="#local-6989586621681127328"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127327"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127327"><span class="hs-identifier hs-var">fvs_e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-114"></span><span>                          </span><span class="hs-comment">-- See Note [Rebindable syntax and Template Haskell]</span><span>
</span><span id="line-115"></span><span>                          </span><span class="annot"><span class="annottext">Extension
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall gbl lcl a. Extension -&gt; TcRnIf gbl lcl a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#unsetXOptM"><span class="hs-identifier hs-var">unsetXOptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#RebindableSyntax"><span class="hs-identifier hs-var">LangExt.RebindableSyntax</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (HsBracket (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses))
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-116"></span><span>                          </span><span class="annot"><span class="annottext">ThStage
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a. ThStage -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#setStage"><span class="hs-identifier hs-var">setStage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ThStage -&gt; PendingStuff -&gt; ThStage
</span><a href="GHC.Tc.Types.html#Brack"><span class="hs-identifier hs-var">Brack</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127356"><span class="hs-identifier hs-var">cur_stage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IORef [PendingRnSplice] -&gt; PendingStuff
</span><a href="GHC.Tc.Types.html#RnPendingUntyped"><span class="hs-identifier hs-var">RnPendingUntyped</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681127330"><span class="hs-identifier hs-var">ps_var</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (HsBracket (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses))
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-117"></span><span>                                   </span><span class="annot"><span class="annottext">ThStage
-&gt; HsBracket GhcPs -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127356"><span class="hs-identifier hs-var">cur_stage</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127367"><span class="hs-identifier hs-var">br_body</span></a></span><span>
</span><span id="line-118"></span><span>                        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127323"><span class="annot"><span class="annottext">[PendingRnSplice]
</span><a href="#local-6989586621681127323"><span class="hs-identifier hs-var">pendings</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [PendingRnSplice]
forall a env. IORef a -&gt; IOEnv env a
</span><a href="GHC.Data.IOEnv.html#readMutVar"><span class="hs-identifier hs-var">readMutVar</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681127330"><span class="hs-identifier hs-var">ps_var</span></a></span><span>
</span><span id="line-119"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed), Uses)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XRnBracketOut (GhcPass 'Renamed)
-&gt; HsBracket (GhcPass 'Renamed)
-&gt; [PendingRnSplice]
-&gt; HsExpr (GhcPass 'Renamed)
forall p.
XRnBracketOut p
-&gt; HsBracket (GhcPass 'Renamed) -&gt; [PendingRnSplice] -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsRnBracketOut"><span class="hs-identifier hs-var">HsRnBracketOut</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XRnBracketOut (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket (GhcPass 'Renamed)
</span><a href="#local-6989586621681127328"><span class="hs-identifier hs-var">body'</span></a></span><span> </span><span class="annot"><span class="annottext">[PendingRnSplice]
</span><a href="#local-6989586621681127323"><span class="hs-identifier hs-var">pendings</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127327"><span class="hs-identifier hs-var">fvs_e</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-120"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-121"></span><span>
</span><span id="line-122"></span><span class="annot"><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-type">rn_bracket</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ThStage"><span class="hs-identifier hs-type">ThStage</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsBracket"><span class="hs-identifier hs-type">HsBracket</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsBracket"><span class="hs-identifier hs-type">HsBracket</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-123"></span><span id="rn_bracket"><span class="annot"><span class="annottext">rn_bracket :: ThStage
-&gt; HsBracket GhcPs -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var hs-var">rn_bracket</span></a></span></span><span> </span><span id="local-6989586621681127320"><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127320"><span class="hs-identifier hs-var">outer_stage</span></a></span></span><span> </span><span id="local-6989586621681127319"><span class="annot"><span class="annottext">br :: HsBracket GhcPs
</span><a href="#local-6989586621681127319"><span class="hs-identifier hs-var">br</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#VarBr"><span class="hs-identifier hs-type">VarBr</span></a></span><span> </span><span id="local-6989586621681127317"><span class="annot"><span class="annottext">XVarBr GhcPs
</span><a href="#local-6989586621681127317"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127316"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127316"><span class="hs-identifier hs-var">flg</span></a></span></span><span> </span><span id="local-6989586621681127315"><span class="annot"><span class="annottext">IdP GhcPs
</span><a href="#local-6989586621681127315"><span class="hs-identifier hs-var">rdr_name</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-124"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127314"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Env.html#lookupOccRn"><span class="hs-identifier hs-var">lookupOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
IdP GhcPs
</span><a href="#local-6989586621681127315"><span class="hs-identifier hs-var">rdr_name</span></a></span><span>
</span><span id="line-125"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127312"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681127312"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-126"></span><span>
</span><span id="line-127"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127316"><span class="hs-identifier hs-var">flg</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681127312"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-128"></span><span>             </span><span class="hs-comment">-- Type variables can be quoted in TH. See #5721.</span><span>
</span><span id="line-129"></span><span>                 </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127308"><span class="annot"><span class="annottext">Maybe (TopLevelFlag, ThLevel)
</span><a href="#local-6989586621681127308"><span class="hs-identifier hs-var">mb_bind_lvl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; RnM (Maybe (TopLevelFlag, ThLevel))
</span><a href="GHC.Rename.Env.html#lookupLocalOccThLvl_maybe"><span class="hs-identifier hs-var">lookupLocalOccThLvl_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-130"></span><span>                    </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (TopLevelFlag, ThLevel)
</span><a href="#local-6989586621681127308"><span class="hs-identifier hs-var">mb_bind_lvl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-131"></span><span>                        </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Maybe (TopLevelFlag, ThLevel)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- Can happen for data constructors,</span><span>
</span><span id="line-132"></span><span>                                                    </span><span class="hs-comment">-- but nothing needs to be done for them</span><span>
</span><span id="line-133"></span><span>
</span><span id="line-134"></span><span>                        </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127306"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681127306"><span class="hs-identifier hs-var">top_lvl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127305"><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681127305"><span class="hs-identifier hs-var">bind_lvl</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- See Note [Quoting names]</span><span>
</span><span id="line-135"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag -&gt; Bool
</span><a href="GHC.Types.Basic.html#isTopLevel"><span class="hs-identifier hs-var">isTopLevel</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681127306"><span class="hs-identifier hs-var">top_lvl</span></a></span><span>
</span><span id="line-136"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isExternalName"><span class="hs-identifier hs-var">isExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#keepAlive"><span class="hs-identifier hs-var">keepAlive</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-137"></span><span>                             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-138"></span><span>                             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rn_bracket VarBr&quot;</span></span><span>
</span><span id="line-139"></span><span>                                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681127305"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span>
</span><span id="line-140"></span><span>                                                </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127320"><span class="hs-identifier hs-var">outer_stage</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-141"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ThStage -&gt; ThLevel
</span><a href="GHC.Tc.Types.html#thLevel"><span class="hs-identifier hs-var">thLevel</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127320"><span class="hs-identifier hs-var">outer_stage</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; ThLevel -&gt; ThLevel
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><span class="hs-number">1</span></span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; ThLevel -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681127305"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span>                                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBracket GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#quotedNameStageErr"><span class="hs-identifier hs-var">quotedNameStageErr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127319"><span class="hs-identifier hs-var">br</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-143"></span><span>                        </span><span class="hs-special">}</span><span>
</span><span id="line-144"></span><span>                    </span><span class="hs-special">}</span><span>
</span><span id="line-145"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XVarBr (GhcPass 'Renamed)
-&gt; Bool -&gt; IdP (GhcPass 'Renamed) -&gt; HsBracket (GhcPass 'Renamed)
forall p. XVarBr p -&gt; Bool -&gt; IdP p -&gt; HsBracket p
</span><a href="GHC.Hs.Expr.html#VarBr"><span class="hs-identifier hs-var">VarBr</span></a></span><span> </span><span class="annot"><span class="annottext">XVarBr GhcPs
XVarBr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127317"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127316"><span class="hs-identifier hs-var">flg</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#unitFV"><span class="hs-identifier hs-var">unitFV</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127314"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-146"></span><span>
</span><span id="line-147"></span><span class="annot"><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#ExpBr"><span class="hs-identifier hs-type">ExpBr</span></a></span><span> </span><span id="local-6989586621681127297"><span class="annot"><span class="annottext">XExpBr GhcPs
</span><a href="#local-6989586621681127297"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127296"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127296"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127295"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127295"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127294"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127294"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127296"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-148"></span><span>                            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XExpBr (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed) -&gt; HsBracket (GhcPass 'Renamed)
forall p. XExpBr p -&gt; LHsExpr p -&gt; HsBracket p
</span><a href="GHC.Hs.Expr.html#ExpBr"><span class="hs-identifier hs-var">ExpBr</span></a></span><span> </span><span class="annot"><span class="annottext">XExpBr GhcPs
XExpBr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127297"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127295"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127294"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span class="annot"><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#PatBr"><span class="hs-identifier hs-type">PatBr</span></a></span><span> </span><span id="local-6989586621681127292"><span class="annot"><span class="annottext">XPatBr GhcPs
</span><a href="#local-6989586621681127292"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127291"><span class="annot"><span class="annottext">LPat GhcPs
</span><a href="#local-6989586621681127291"><span class="hs-identifier hs-var">p</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-151"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsMatchContext (GhcPass 'Renamed)
-&gt; LPat GhcPs
-&gt; (LPat (GhcPass 'Renamed)
    -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses))
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a.
HsMatchContext (GhcPass 'Renamed)
-&gt; LPat GhcPs
-&gt; (LPat (GhcPass 'Renamed) -&gt; RnM (a, Uses))
-&gt; RnM (a, Uses)
</span><a href="GHC.Rename.Pat.html#rnPat"><span class="hs-identifier hs-var">rnPat</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext (GhcPass 'Renamed)
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#ThPatQuote"><span class="hs-identifier hs-var">ThPatQuote</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcPs
</span><a href="#local-6989586621681127291"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">((LPat (GhcPass 'Renamed)
  -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses))
 -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses))
-&gt; (LPat (GhcPass 'Renamed)
    -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses))
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621681127289"><span class="annot"><span class="annottext">LPat (GhcPass 'Renamed)
</span><a href="#local-6989586621681127289"><span class="hs-identifier hs-var">p'</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XPatBr (GhcPass 'Renamed)
-&gt; LPat (GhcPass 'Renamed) -&gt; HsBracket (GhcPass 'Renamed)
forall p. XPatBr p -&gt; LPat p -&gt; HsBracket p
</span><a href="GHC.Hs.Expr.html#PatBr"><span class="hs-identifier hs-var">PatBr</span></a></span><span> </span><span class="annot"><span class="annottext">XPatBr GhcPs
XPatBr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127292"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LPat (GhcPass 'Renamed)
</span><a href="#local-6989586621681127289"><span class="hs-identifier hs-var">p'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-152"></span><span>
</span><span id="line-153"></span><span class="annot"><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TypBr"><span class="hs-identifier hs-type">TypBr</span></a></span><span> </span><span id="local-6989586621681127286"><span class="annot"><span class="annottext">XTypBr GhcPs
</span><a href="#local-6989586621681127286"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127285"><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681127285"><span class="hs-identifier hs-var">t</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127284"><span class="annot"><span class="annottext">LHsType (GhcPass 'Renamed)
</span><a href="#local-6989586621681127284"><span class="hs-identifier hs-var">t'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127283"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127283"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsDocContext
-&gt; LHsType GhcPs -&gt; RnM (LHsType (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.HsType.html#rnLHsType"><span class="hs-identifier hs-var">rnLHsType</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="GHC.Rename.Utils.html#TypBrCtx"><span class="hs-identifier hs-var">TypBrCtx</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681127285"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-154"></span><span>                              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XTypBr (GhcPass 'Renamed)
-&gt; LHsType (GhcPass 'Renamed) -&gt; HsBracket (GhcPass 'Renamed)
forall p. XTypBr p -&gt; LHsType p -&gt; HsBracket p
</span><a href="GHC.Hs.Expr.html#TypBr"><span class="hs-identifier hs-var">TypBr</span></a></span><span> </span><span class="annot"><span class="annottext">XTypBr GhcPs
XTypBr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127286"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType (GhcPass 'Renamed)
</span><a href="#local-6989586621681127284"><span class="hs-identifier hs-var">t'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127283"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-155"></span><span>
</span><span id="line-156"></span><span class="annot"><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#DecBrL"><span class="hs-identifier hs-type">DecBrL</span></a></span><span> </span><span id="local-6989586621681127280"><span class="annot"><span class="annottext">XDecBrL GhcPs
</span><a href="#local-6989586621681127280"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127279"><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681127279"><span class="hs-identifier hs-var">decls</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-157"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127278"><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127278"><span class="hs-identifier hs-var">group</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs] -&gt; RnM (HsGroup GhcPs)
</span><a href="#local-6989586621681127277"><span class="hs-identifier hs-var">groupDecls</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681127279"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-158"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127276"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681127276"><span class="hs-identifier hs-var">gbl_env</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-159"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681127274"><span class="annot"><span class="annottext">new_gbl_env :: TcGblEnv
</span><a href="#local-6989586621681127274"><span class="hs-identifier hs-var hs-var">new_gbl_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681127276"><span class="hs-identifier hs-var">gbl_env</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">tcg_dus :: DefUses
</span><a href="GHC.Tc.Types.html#tcg_dus"><span class="hs-identifier hs-var">tcg_dus</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DefUses
</span><a href="GHC.Types.Name.Set.html#emptyDUs"><span class="hs-identifier hs-var">emptyDUs</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-160"></span><span>                          </span><span class="hs-comment">-- The emptyDUs is so that we just collect uses for this</span><span>
</span><span id="line-161"></span><span>                          </span><span class="hs-comment">-- group alone in the call to rnSrcDecls below</span><span>
</span><span id="line-162"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127271"><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681127271"><span class="hs-identifier hs-var">tcg_env</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127270"><span class="annot"><span class="annottext">HsGroup (GhcPass 'Renamed)
</span><a href="#local-6989586621681127270"><span class="hs-identifier hs-var">group'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcGblEnv
-&gt; TcRnIf TcGblEnv TcLclEnv (TcGblEnv, HsGroup (GhcPass 'Renamed))
-&gt; TcRnIf TcGblEnv TcLclEnv (TcGblEnv, HsGroup (GhcPass 'Renamed))
forall gbl lcl a. gbl -&gt; TcRnIf gbl lcl a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#setGblEnv"><span class="hs-identifier hs-var">setGblEnv</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681127274"><span class="hs-identifier hs-var">new_gbl_env</span></a></span><span> </span><span class="annot"><span class="annottext">(TcRnIf TcGblEnv TcLclEnv (TcGblEnv, HsGroup (GhcPass 'Renamed))
 -&gt; TcRnIf TcGblEnv TcLclEnv (TcGblEnv, HsGroup (GhcPass 'Renamed)))
-&gt; TcRnIf TcGblEnv TcLclEnv (TcGblEnv, HsGroup (GhcPass 'Renamed))
-&gt; TcRnIf TcGblEnv TcLclEnv (TcGblEnv, HsGroup (GhcPass 'Renamed))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-163"></span><span>                              </span><span class="annot"><span class="annottext">HsGroup GhcPs
-&gt; TcRnIf TcGblEnv TcLclEnv (TcGblEnv, HsGroup (GhcPass 'Renamed))
</span><a href="GHC.Rename.Module.html#rnSrcDecls"><span class="hs-identifier hs-var">rnSrcDecls</span></a></span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127278"><span class="hs-identifier hs-var">group</span></a></span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span>              </span><span class="hs-comment">-- Discard the tcg_env; it contains only extra info about fixity</span><span>
</span><span id="line-166"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rn_bracket dec&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUses -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv -&gt; DefUses
</span><a href="GHC.Tc.Types.html#tcg_dus"><span class="hs-identifier hs-var hs-var">tcg_dus</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681127271"><span class="hs-identifier hs-var">tcg_env</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span>
</span><span id="line-167"></span><span>                   </span><span class="annot"><span class="annottext">Uses -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DefUses -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#duUses"><span class="hs-identifier hs-var">duUses</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv -&gt; DefUses
</span><a href="GHC.Tc.Types.html#tcg_dus"><span class="hs-identifier hs-var hs-var">tcg_dus</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681127271"><span class="hs-identifier hs-var">tcg_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XDecBrG (GhcPass 'Renamed)
-&gt; HsGroup (GhcPass 'Renamed) -&gt; HsBracket (GhcPass 'Renamed)
forall p. XDecBrG p -&gt; HsGroup p -&gt; HsBracket p
</span><a href="GHC.Hs.Expr.html#DecBrG"><span class="hs-identifier hs-var">DecBrG</span></a></span><span> </span><span class="annot"><span class="annottext">XDecBrG (GhcPass 'Renamed)
XDecBrL GhcPs
</span><a href="#local-6989586621681127280"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">HsGroup (GhcPass 'Renamed)
</span><a href="#local-6989586621681127270"><span class="hs-identifier hs-var">group'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DefUses -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#duUses"><span class="hs-identifier hs-var">duUses</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcGblEnv -&gt; DefUses
</span><a href="GHC.Tc.Types.html#tcg_dus"><span class="hs-identifier hs-var hs-var">tcg_dus</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv
</span><a href="#local-6989586621681127271"><span class="hs-identifier hs-var">tcg_env</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-169"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-170"></span><span>    </span><span class="annot"><a href="#local-6989586621681127277"><span class="hs-identifier hs-type">groupDecls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Decls.html#LHsDecl"><span class="hs-identifier hs-type">LHsDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#HsGroup"><span class="hs-identifier hs-type">HsGroup</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-171"></span><span>    </span><span id="local-6989586621681127277"><span class="annot"><span class="annottext">groupDecls :: [LHsDecl GhcPs] -&gt; RnM (HsGroup GhcPs)
</span><a href="#local-6989586621681127277"><span class="hs-identifier hs-var hs-var">groupDecls</span></a></span></span><span> </span><span id="local-6989586621681127265"><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681127265"><span class="hs-identifier hs-var">decls</span></a></span></span><span>
</span><span id="line-172"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127264"><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127264"><span class="hs-identifier hs-var">group</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127263"><span class="annot"><span class="annottext">Maybe (SpliceDecl GhcPs, [LHsDecl GhcPs])
</span><a href="#local-6989586621681127263"><span class="hs-identifier hs-var">mb_splice</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
-&gt; RnM (HsGroup GhcPs, Maybe (SpliceDecl GhcPs, [LHsDecl GhcPs]))
</span><a href="GHC.Rename.Module.html#findSplice"><span class="hs-identifier hs-var">findSplice</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681127265"><span class="hs-identifier hs-var">decls</span></a></span><span>
</span><span id="line-173"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (SpliceDecl GhcPs, [LHsDecl GhcPs])
</span><a href="#local-6989586621681127263"><span class="hs-identifier hs-var">mb_splice</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-174"></span><span>           </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Maybe (SpliceDecl GhcPs, [LHsDecl GhcPs])
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs -&gt; RnM (HsGroup GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127264"><span class="hs-identifier hs-var">group</span></a></span><span>
</span><span id="line-175"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127262"><span class="annot"><span class="annottext">SpliceDecl GhcPs
</span><a href="#local-6989586621681127262"><span class="hs-identifier hs-var">splice</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127261"><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681127261"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-176"></span><span>               </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127260"><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127260"><span class="hs-identifier hs-var">group'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs] -&gt; RnM (HsGroup GhcPs)
</span><a href="#local-6989586621681127277"><span class="hs-identifier hs-var">groupDecls</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681127261"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-177"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681127259"><span class="annot"><span class="annottext">group'' :: HsGroup GhcPs
</span><a href="#local-6989586621681127259"><span class="hs-identifier hs-var hs-var">group''</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs -&gt; HsGroup GhcPs -&gt; HsGroup GhcPs
forall (p :: Pass).
HsGroup (GhcPass p) -&gt; HsGroup (GhcPass p) -&gt; HsGroup (GhcPass p)
</span><a href="GHC.Hs.Decls.html#appendGroups"><span class="hs-identifier hs-var">appendGroups</span></a></span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127264"><span class="hs-identifier hs-var">group</span></a></span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127260"><span class="hs-identifier hs-var">group'</span></a></span><span>
</span><span id="line-178"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs -&gt; RnM (HsGroup GhcPs)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127259"><span class="hs-identifier hs-var">group''</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">hs_splcds :: [LSpliceDecl GhcPs]
</span><a href="GHC.Hs.Decls.html#hs_splcds"><span class="hs-identifier hs-var">hs_splcds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SpliceDecl GhcPs -&gt; LSpliceDecl GhcPs
forall e. e -&gt; Located e
</span><a href="GHC.Types.SrcLoc.html#noLoc"><span class="hs-identifier hs-var">noLoc</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceDecl GhcPs
</span><a href="#local-6989586621681127262"><span class="hs-identifier hs-var">splice</span></a></span><span> </span><span class="annot"><span class="annottext">LSpliceDecl GhcPs -&gt; [LSpliceDecl GhcPs] -&gt; [LSpliceDecl GhcPs]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs -&gt; [LSpliceDecl GhcPs]
forall p. HsGroup p -&gt; [LSpliceDecl p]
</span><a href="GHC.Hs.Decls.html#hs_splcds"><span class="hs-identifier hs-var hs-var">hs_splcds</span></a></span><span> </span><span class="annot"><span class="annottext">HsGroup GhcPs
</span><a href="#local-6989586621681127260"><span class="hs-identifier hs-var">group'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-179"></span><span>                  </span><span class="hs-special">}</span><span>
</span><span id="line-180"></span><span>           </span><span class="hs-special">}</span><span class="hs-special">}</span><span>
</span><span id="line-181"></span><span>
</span><span id="line-182"></span><span class="annot"><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#DecBrG"><span class="hs-identifier hs-type">DecBrG</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rn_bracket: unexpected DecBrG&quot;</span></span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span class="annot"><a href="GHC.Rename.Splice.html#rn_bracket"><span class="hs-identifier hs-var">rn_bracket</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#TExpBr"><span class="hs-identifier hs-type">TExpBr</span></a></span><span> </span><span id="local-6989586621681127253"><span class="annot"><span class="annottext">XTExpBr GhcPs
</span><a href="#local-6989586621681127253"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127252"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127252"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127251"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127251"><span class="hs-identifier hs-var">e'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127250"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127250"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127252"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-185"></span><span>                               </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsBracket (GhcPass 'Renamed), Uses)
-&gt; TcM (HsBracket (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XTExpBr (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed) -&gt; HsBracket (GhcPass 'Renamed)
forall p. XTExpBr p -&gt; LHsExpr p -&gt; HsBracket p
</span><a href="GHC.Hs.Expr.html#TExpBr"><span class="hs-identifier hs-var">TExpBr</span></a></span><span> </span><span class="annot"><span class="annottext">XTExpBr GhcPs
XTExpBr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127253"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127251"><span class="hs-identifier hs-var">e'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127250"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span class="annot"><a href="GHC.Rename.Splice.html#quotationCtxtDoc"><span class="hs-identifier hs-type">quotationCtxtDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsBracket"><span class="hs-identifier hs-type">HsBracket</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-188"></span><span id="quotationCtxtDoc"><span class="annot"><span class="annottext">quotationCtxtDoc :: HsBracket GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#quotationCtxtDoc"><span class="hs-identifier hs-var hs-var">quotationCtxtDoc</span></a></span></span><span> </span><span id="local-6989586621681127248"><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127248"><span class="hs-identifier hs-var">br_body</span></a></span></span><span>
</span><span id="line-189"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; ThLevel -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the Template Haskell quotation&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-190"></span><span>         </span><span class="annot"><span class="annottext">ThLevel
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBracket GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127248"><span class="hs-identifier hs-var">br_body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>
</span><span id="line-192"></span><span class="annot"><a href="GHC.Rename.Splice.html#illegalBracket"><span class="hs-identifier hs-type">illegalBracket</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-193"></span><span id="illegalBracket"><span class="annot"><span class="annottext">illegalBracket :: MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalBracket"><span class="hs-identifier hs-var hs-var">illegalBracket</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-194"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Template Haskell brackets cannot be nested&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span>
</span><span id="line-195"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;(without intervening splices)&quot;</span></span><span>
</span><span id="line-196"></span><span>
</span><span id="line-197"></span><span class="annot"><a href="GHC.Rename.Splice.html#illegalTypedBracket"><span class="hs-identifier hs-type">illegalTypedBracket</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-198"></span><span id="illegalTypedBracket"><span class="annot"><span class="annottext">illegalTypedBracket :: MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalTypedBracket"><span class="hs-identifier hs-var hs-var">illegalTypedBracket</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-199"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Typed brackets may only appear in typed splices.&quot;</span></span><span>
</span><span id="line-200"></span><span>
</span><span id="line-201"></span><span class="annot"><a href="GHC.Rename.Splice.html#illegalUntypedBracket"><span class="hs-identifier hs-type">illegalUntypedBracket</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-202"></span><span id="illegalUntypedBracket"><span class="annot"><span class="annottext">illegalUntypedBracket :: MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalUntypedBracket"><span class="hs-identifier hs-var hs-var">illegalUntypedBracket</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-203"></span><span>    </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Untyped brackets may only appear in untyped splices.&quot;</span></span><span>
</span><span id="line-204"></span><span>
</span><span id="line-205"></span><span class="annot"><a href="GHC.Rename.Splice.html#quotedNameStageErr"><span class="hs-identifier hs-type">quotedNameStageErr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsBracket"><span class="hs-identifier hs-type">HsBracket</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-206"></span><span id="quotedNameStageErr"><span class="annot"><span class="annottext">quotedNameStageErr :: HsBracket GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#quotedNameStageErr"><span class="hs-identifier hs-var hs-var">quotedNameStageErr</span></a></span></span><span> </span><span id="local-6989586621681127246"><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127246"><span class="hs-identifier hs-var">br</span></a></span></span><span>
</span><span id="line-207"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Stage error: the non-top-level quoted name&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsBracket GhcPs
</span><a href="#local-6989586621681127246"><span class="hs-identifier hs-var">br</span></a></span><span>
</span><span id="line-208"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;must be used at the same stage at which it is bound&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span>
</span><span id="line-211"></span><span class="hs-comment">{-
*********************************************************
*                                                      *
                Splices
*                                                      *
*********************************************************

Note [Free variables of typed splices]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider renaming this:
        f = ...
        h = ...$(thing &quot;f&quot;)...

where the splice is a *typed* splice.  The splice can expand into
literally anything, so when we do dependency analysis we must assume
that it might mention 'f'.  So we simply treat all locally-defined
names as mentioned by any splice.  This is terribly brutal, but I
don't see what else to do.  For example, it'll mean that every
locally-defined thing will appear to be used, so no unused-binding
warnings.  But if we miss the dependency, then we might typecheck 'h'
before 'f', and that will crash the type checker because 'f' isn't in
scope.

Currently, I'm not treating a splice as also mentioning every import,
which is a bit inconsistent -- but there are a lot of them.  We might
thereby get some bogus unused-import warnings, but we won't crash the
type checker.  Not very satisfactory really.

Note [Renamer errors]
~~~~~~~~~~~~~~~~~~~~~
It's important to wrap renamer calls in checkNoErrs, because the
renamer does not fail for out of scope variables etc. Instead it
returns a bogus term/type, so that it can report more than one error.
We don't want the type checker to see these bogus unbound variables.
-}</span><span>
</span><span id="line-246"></span><span>
</span><span id="line-247"></span><span id="local-6989586621681127702"><span class="annot"><a href="GHC.Rename.Splice.html#rnSpliceGen"><span class="hs-identifier hs-type">rnSpliceGen</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681127702"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-248"></span><span>                                            </span><span class="hs-comment">-- Outside brackets, run splice</span><span>
</span><span id="line-249"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-type">PendingRnSplice</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="#local-6989586621681127702"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>                                            </span><span class="hs-comment">-- Inside brackets, make it pending</span><span>
</span><span id="line-251"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span>
</span><span id="line-252"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681127702"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span></span><span>
</span><span id="line-253"></span><span id="rnSpliceGen"><span class="annot"><span class="annottext">rnSpliceGen :: forall a.
(HsSplice (GhcPass 'Renamed) -&gt; RnM (a, Uses))
-&gt; (HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a))
-&gt; HsSplice GhcPs
-&gt; RnM (a, Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceGen"><span class="hs-identifier hs-var hs-var">rnSpliceGen</span></a></span></span><span> </span><span id="local-6989586621681127230"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; RnM (a, Uses)
</span><a href="#local-6989586621681127230"><span class="hs-identifier hs-var">run_splice</span></a></span></span><span> </span><span id="local-6989586621681127229"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a)
</span><a href="#local-6989586621681127229"><span class="hs-identifier hs-var">pend_splice</span></a></span></span><span> </span><span id="local-6989586621681127228"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127228"><span class="hs-identifier hs-var">splice</span></a></span></span><span>
</span><span id="line-254"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; RnM (a, Uses) -&gt; RnM (a, Uses)
forall a. MsgDoc -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#addErrCtxt"><span class="hs-identifier hs-var">addErrCtxt</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#spliceCtxt"><span class="hs-identifier hs-var">spliceCtxt</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127228"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(RnM (a, Uses) -&gt; RnM (a, Uses)) -&gt; RnM (a, Uses) -&gt; RnM (a, Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-255"></span><span>    </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127226"><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127226"><span class="hs-identifier hs-var">stage</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM ThStage
</span><a href="GHC.Tc.Utils.Monad.html#getStage"><span class="hs-identifier hs-var">getStage</span></a></span><span>
</span><span id="line-256"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127226"><span class="hs-identifier hs-var">stage</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-257"></span><span>        </span><span class="annot"><a href="GHC.Tc.Types.html#Brack"><span class="hs-identifier hs-type">Brack</span></a></span><span> </span><span id="local-6989586621681127225"><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127225"><span class="hs-identifier hs-var">pop_stage</span></a></span></span><span> </span><span class="annot"><span class="annottext">PendingStuff
</span><a href="GHC.Tc.Types.html#RnPendingTyped"><span class="hs-identifier hs-var">RnPendingTyped</span></a></span><span>
</span><span id="line-258"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127224"><span class="hs-identifier hs-var">is_typed_splice</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalUntypedSplice"><span class="hs-identifier hs-var">illegalUntypedSplice</span></a></span><span>
</span><span id="line-259"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127222"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127222"><span class="hs-identifier hs-var">splice'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127221"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127221"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ThStage
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a. ThStage -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#setStage"><span class="hs-identifier hs-var">setStage</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127225"><span class="hs-identifier hs-var">pop_stage</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (HsSplice (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses))
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-260"></span><span>                                    </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var">rnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127228"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-261"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127219"><span class="annot"><span class="annottext">PendingRnSplice
</span><a href="#local-6989586621681127219"><span class="hs-identifier hs-var">_pending_splice</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127218"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127218"><span class="hs-identifier hs-var">result</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a)
</span><a href="#local-6989586621681127229"><span class="hs-identifier hs-var">pend_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127222"><span class="hs-identifier hs-var">splice'</span></a></span><span>
</span><span id="line-262"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, Uses) -&gt; RnM (a, Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127218"><span class="hs-identifier hs-var">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127221"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span>        </span><span class="annot"><a href="GHC.Tc.Types.html#Brack"><span class="hs-identifier hs-type">Brack</span></a></span><span> </span><span id="local-6989586621681127217"><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127217"><span class="hs-identifier hs-var">pop_stage</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#RnPendingUntyped"><span class="hs-identifier hs-type">RnPendingUntyped</span></a></span><span> </span><span id="local-6989586621681127216"><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681127216"><span class="hs-identifier hs-var">ps_var</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#checkTc"><span class="hs-identifier hs-var">checkTc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127224"><span class="hs-identifier hs-var">is_typed_splice</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalTypedSplice"><span class="hs-identifier hs-var">illegalTypedSplice</span></a></span><span>
</span><span id="line-266"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127214"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127214"><span class="hs-identifier hs-var">splice'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127213"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127213"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ThStage
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a. ThStage -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#setStage"><span class="hs-identifier hs-var">setStage</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681127217"><span class="hs-identifier hs-var">pop_stage</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (HsSplice (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses))
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-267"></span><span>                                    </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var">rnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127228"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-268"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127212"><span class="annot"><span class="annottext">PendingRnSplice
</span><a href="#local-6989586621681127212"><span class="hs-identifier hs-var">pending_splice</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127211"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127211"><span class="hs-identifier hs-var">result</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a)
</span><a href="#local-6989586621681127229"><span class="hs-identifier hs-var">pend_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127214"><span class="hs-identifier hs-var">splice'</span></a></span><span>
</span><span id="line-269"></span><span>                </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127210"><span class="annot"><span class="annottext">[PendingRnSplice]
</span><a href="#local-6989586621681127210"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [PendingRnSplice]
forall a env. IORef a -&gt; IOEnv env a
</span><a href="GHC.Data.IOEnv.html#readMutVar"><span class="hs-identifier hs-var">readMutVar</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681127216"><span class="hs-identifier hs-var">ps_var</span></a></span><span>
</span><span id="line-270"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
-&gt; [PendingRnSplice] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a env. IORef a -&gt; a -&gt; IOEnv env ()
</span><a href="GHC.Data.IOEnv.html#writeMutVar"><span class="hs-identifier hs-var">writeMutVar</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681127216"><span class="hs-identifier hs-var">ps_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PendingRnSplice
</span><a href="#local-6989586621681127212"><span class="hs-identifier hs-var">pending_splice</span></a></span><span> </span><span class="annot"><span class="annottext">PendingRnSplice -&gt; [PendingRnSplice] -&gt; [PendingRnSplice]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[PendingRnSplice]
</span><a href="#local-6989586621681127210"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span>                </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, Uses) -&gt; RnM (a, Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127211"><span class="hs-identifier hs-var">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127213"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span>        </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#checkTopSpliceAllowed"><span class="hs-identifier hs-var">checkTopSpliceAllowed</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127228"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-274"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127207"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127207"><span class="hs-identifier hs-var">splice'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127206"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127206"><span class="hs-identifier hs-var">fvs1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (HsSplice (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses))
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-275"></span><span>                                         </span><span class="annot"><span class="annottext">ThStage
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a. ThStage -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#setStage"><span class="hs-identifier hs-var">setStage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SpliceType -&gt; ThStage
</span><a href="GHC.Tc.Types.html#Splice"><span class="hs-identifier hs-var">Splice</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceType
</span><a href="#local-6989586621681127204"><span class="hs-identifier hs-var">splice_type</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (HsSplice (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses))
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-276"></span><span>                                         </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var">rnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127228"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-277"></span><span>                   </span><span class="hs-comment">-- checkNoErrs: don't attempt to run the splice if</span><span>
</span><span id="line-278"></span><span>                   </span><span class="hs-comment">-- renaming it failed; otherwise we get a cascade of</span><span>
</span><span id="line-279"></span><span>                   </span><span class="hs-comment">-- errors from e.g. unbound variables</span><span>
</span><span id="line-280"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127203"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127203"><span class="hs-identifier hs-var">result</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127202"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127202"><span class="hs-identifier hs-var">fvs2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; RnM (a, Uses)
</span><a href="#local-6989586621681127230"><span class="hs-identifier hs-var">run_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127207"><span class="hs-identifier hs-var">splice'</span></a></span><span>
</span><span id="line-281"></span><span>                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(a, Uses) -&gt; RnM (a, Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127203"><span class="hs-identifier hs-var">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127206"><span class="hs-identifier hs-var">fvs1</span></a></span><span> </span><span class="annot"><span class="annottext">Uses -&gt; Uses -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127202"><span class="hs-identifier hs-var">fvs2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-282"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-283"></span><span>     </span><span id="local-6989586621681127224"><span class="annot"><span class="annottext">is_typed_splice :: Bool
</span><a href="#local-6989586621681127224"><span class="hs-identifier hs-var hs-var">is_typed_splice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; Bool
forall id. HsSplice id -&gt; Bool
</span><a href="GHC.Hs.Expr.html#isTypedSplice"><span class="hs-identifier hs-var">isTypedSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127228"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-284"></span><span>     </span><span id="local-6989586621681127204"><span class="annot"><span class="annottext">splice_type :: SpliceType
</span><a href="#local-6989586621681127204"><span class="hs-identifier hs-var hs-var">splice_type</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127224"><span class="hs-identifier hs-var">is_typed_splice</span></a></span><span>
</span><span id="line-285"></span><span>                   </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">SpliceType
</span><a href="GHC.Tc.Types.html#Typed"><span class="hs-identifier hs-var">Typed</span></a></span><span>
</span><span id="line-286"></span><span>                   </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">SpliceType
</span><a href="GHC.Tc.Types.html#Untyped"><span class="hs-identifier hs-var">Untyped</span></a></span><span>
</span><span id="line-287"></span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span class="hs-comment">-- Nested splices are fine without TemplateHaskell because they</span><span>
</span><span id="line-290"></span><span class="hs-comment">-- are not executed until the top-level splice is run.</span><span>
</span><span id="line-291"></span><span class="annot"><a href="GHC.Rename.Splice.html#checkTopSpliceAllowed"><span class="hs-identifier hs-type">checkTopSpliceAllowed</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-292"></span><span id="checkTopSpliceAllowed"><span class="annot"><span class="annottext">checkTopSpliceAllowed :: HsSplice GhcPs -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#checkTopSpliceAllowed"><span class="hs-identifier hs-var hs-var">checkTopSpliceAllowed</span></a></span></span><span> </span><span id="local-6989586621681127199"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127199"><span class="hs-identifier hs-var">splice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-293"></span><span>  </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127198"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681127198"><span class="hs-identifier hs-var">herald</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127197"><span class="annot"><span class="annottext">Extension
</span><a href="#local-6989586621681127197"><span class="hs-identifier hs-var">ext</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; (String, Extension)
</span><a href="#local-6989586621681127196"><span class="hs-identifier hs-var">spliceExtension</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127199"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-294"></span><span>  </span><span id="local-6989586621681127195"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127195"><span class="hs-identifier hs-var">extEnabled</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf TcGblEnv TcLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="#local-6989586621681127197"><span class="hs-identifier hs-var">ext</span></a></span><span>
</span><span id="line-295"></span><span>  </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/Control.Monad.html#unless"><span class="hs-identifier hs-var">unless</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127195"><span class="hs-identifier hs-var">extEnabled</span></a></span><span>
</span><span id="line-296"></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a. MsgDoc -&gt; TcRn a
</span><a href="GHC.Tc.Utils.Monad.html#failWith"><span class="hs-identifier hs-var">failWith</span></a></span><span> </span><span class="annot"><span class="annottext">(MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681127198"><span class="hs-identifier hs-var">herald</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;are not permitted without&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Extension -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="#local-6989586621681127197"><span class="hs-identifier hs-var">ext</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-297"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-298"></span><span>     </span><span class="annot"><a href="#local-6989586621681127196"><span class="hs-identifier hs-type">spliceExtension</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#Extension"><span class="hs-identifier hs-type">LangExt.Extension</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-299"></span><span>     </span><span id="local-6989586621681127196"><span class="annot"><span class="annottext">spliceExtension :: HsSplice GhcPs -&gt; (String, Extension)
</span><a href="#local-6989586621681127196"><span class="hs-identifier hs-var hs-var">spliceExtension</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsQuasiQuote"><span class="hs-identifier hs-type">HsQuasiQuote</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Quasi-quotes&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#QuasiQuotes"><span class="hs-identifier hs-var">LangExt.QuasiQuotes</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-300"></span><span>     </span><span class="annot"><a href="#local-6989586621681127196"><span class="hs-identifier hs-var">spliceExtension</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsTypedSplice"><span class="hs-identifier hs-type">HsTypedSplice</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Top-level splices&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#TemplateHaskell"><span class="hs-identifier hs-var">LangExt.TemplateHaskell</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-301"></span><span>     </span><span class="annot"><a href="#local-6989586621681127196"><span class="hs-identifier hs-var">spliceExtension</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsUntypedSplice"><span class="hs-identifier hs-type">HsUntypedSplice</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Top-level splices&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#TemplateHaskell"><span class="hs-identifier hs-var">LangExt.TemplateHaskell</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>     </span><span class="annot"><a href="#local-6989586621681127196"><span class="hs-identifier hs-var">spliceExtension</span></a></span><span> </span><span id="local-6989586621681127189"><span class="annot"><span class="annottext">s :: HsSplice GhcPs
</span><a href="#local-6989586621681127189"><span class="hs-identifier hs-var">s</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; (String, Extension)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;spliceExtension&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127189"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-comment">------------------</span><span>
</span><span id="line-305"></span><span>
</span><span id="line-306"></span><span class="hs-comment">-- | Returns the result of running a splice and the modFinalizers collected</span><span>
</span><span id="line-307"></span><span class="hs-comment">-- during the execution.</span><span>
</span><span id="line-308"></span><span class="hs-comment">--</span><span>
</span><span id="line-309"></span><span class="hs-comment">-- See Note [Delaying modFinalizers in untyped splices].</span><span>
</span><span id="line-310"></span><span id="local-6989586621681127694"><span class="annot"><a href="GHC.Rename.Splice.html#runRnSplice"><span class="hs-identifier hs-type">runRnSplice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#UntypedSpliceFlavour"><span class="hs-identifier hs-type">UntypedSpliceFlavour</span></a></span><span>
</span><span id="line-311"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRn"><span class="hs-identifier hs-type">TcRn</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681127694"><span class="hs-identifier hs-type">res</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-312"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681127694"><span class="hs-identifier hs-type">res</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- How to pretty-print res</span><span>
</span><span id="line-313"></span><span>                                </span><span class="hs-comment">-- Usually just ppr, but not for [Decl]</span><span>
</span><span id="line-314"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>   </span><span class="hs-comment">-- Always untyped</span><span>
</span><span id="line-315"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRn"><span class="hs-identifier hs-type">TcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621681127694"><span class="hs-identifier hs-type">res</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignRef"><span class="hs-identifier hs-type">ForeignRef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#Q"><span class="hs-identifier hs-type">TH.Q</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span></span><span>
</span><span id="line-316"></span><span id="runRnSplice"><span class="annot"><span class="annottext">runRnSplice :: forall res.
UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn res)
-&gt; (res -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (res, [ForeignRef (Q ())])
</span><a href="GHC.Rename.Splice.html#runRnSplice"><span class="hs-identifier hs-var hs-var">runRnSplice</span></a></span></span><span> </span><span id="local-6989586621681127167"><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127167"><span class="hs-identifier hs-var">flavour</span></a></span></span><span> </span><span id="local-6989586621681127166"><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; TcRn res
</span><a href="#local-6989586621681127166"><span class="hs-identifier hs-var">run_meta</span></a></span></span><span> </span><span id="local-6989586621681127165"><span class="annot"><span class="annottext">res -&gt; MsgDoc
</span><a href="#local-6989586621681127165"><span class="hs-identifier hs-var">ppr_res</span></a></span></span><span> </span><span id="local-6989586621681127164"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127164"><span class="hs-identifier hs-var">splice</span></a></span></span><span>
</span><span id="line-317"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127163"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127163"><span class="hs-identifier hs-var">splice'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Hooks
 -&gt; Maybe
      (HsSplice (GhcPass 'Renamed) -&gt; RnM (HsSplice (GhcPass 'Renamed))))
-&gt; (HsSplice (GhcPass 'Renamed)
    -&gt; RnM (HsSplice (GhcPass 'Renamed)))
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv)
     (HsSplice (GhcPass 'Renamed) -&gt; RnM (HsSplice (GhcPass 'Renamed)))
forall (f :: * -&gt; *) a.
(Functor f, HasDynFlags f) =&gt;
(Hooks -&gt; Maybe a) -&gt; a -&gt; f a
</span><a href="GHC.Driver.Hooks.html#getHooked"><span class="hs-identifier hs-var">getHooked</span></a></span><span> </span><span class="annot"><span class="annottext">Hooks
-&gt; Maybe
     (HsSplice (GhcPass 'Renamed) -&gt; RnM (HsSplice (GhcPass 'Renamed)))
</span><a href="GHC.Driver.Hooks.html#runRnSpliceHook"><span class="hs-identifier hs-var hs-var">runRnSpliceHook</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; RnM (HsSplice (GhcPass 'Renamed))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">IOEnv
  (Env TcGblEnv TcLclEnv)
  (HsSplice (GhcPass 'Renamed) -&gt; RnM (HsSplice (GhcPass 'Renamed)))
-&gt; ((HsSplice (GhcPass 'Renamed)
     -&gt; RnM (HsSplice (GhcPass 'Renamed)))
    -&gt; RnM (HsSplice (GhcPass 'Renamed)))
-&gt; RnM (HsSplice (GhcPass 'Renamed))
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed) -&gt; RnM (HsSplice (GhcPass 'Renamed)))
-&gt; HsSplice (GhcPass 'Renamed) -&gt; RnM (HsSplice (GhcPass 'Renamed))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127164"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681127160"><span class="annot"><span class="annottext">the_expr :: LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127160"><span class="hs-identifier hs-var hs-var">the_expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127163"><span class="hs-identifier hs-var">splice'</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-320"></span><span>                </span><span class="annot"><a href="GHC.Hs.Expr.html#HsUntypedSplice"><span class="hs-identifier hs-type">HsUntypedSplice</span></a></span><span> </span><span class="annot"><span class="annottext">XUntypedSplice (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SpliceDecoration
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681127159"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127159"><span class="hs-identifier hs-var">e</span></a></span></span><span>   </span><span class="hs-glyph">-&gt;</span><span>  </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127159"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-321"></span><span>                </span><span class="annot"><a href="GHC.Hs.Expr.html#HsQuasiQuote"><span class="hs-identifier hs-type">HsQuasiQuote</span></a></span><span> </span><span class="annot"><span class="annottext">XQuasiQuote (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681127158"><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127158"><span class="hs-identifier hs-var">q</span></a></span></span><span> </span><span id="local-6989586621681127157"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127157"><span class="hs-identifier hs-var">qs</span></a></span></span><span> </span><span id="local-6989586621681127156"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127156"><span class="hs-identifier hs-var">str</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; Name -&gt; SrcSpan -&gt; FastString -&gt; LHsExpr (GhcPass 'Renamed)
</span><a href="GHC.Rename.Splice.html#mkQuasiQuoteExpr"><span class="hs-identifier hs-var">mkQuasiQuoteExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127167"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127158"><span class="hs-identifier hs-var">q</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127157"><span class="hs-identifier hs-var">qs</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127156"><span class="hs-identifier hs-var">str</span></a></span><span>
</span><span id="line-322"></span><span>                </span><span class="annot"><a href="GHC.Hs.Expr.html#HsTypedSplice"><span class="hs-identifier hs-type">HsTypedSplice</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; LHsExpr (GhcPass 'Renamed)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;runRnSplice&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127164"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-323"></span><span>                </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; LHsExpr (GhcPass 'Renamed)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;runRnSplice&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127164"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span>             </span><span class="hs-comment">-- Typecheck the expression</span><span>
</span><span id="line-326"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127154"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681127154"><span class="hs-identifier hs-var">meta_exp_ty</span></a></span></span><span>   </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcM Type
</span><a href="GHC.Tc.Utils.Env.html#tcMetaTy"><span class="hs-identifier hs-var">tcMetaTy</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127153"><span class="hs-identifier hs-var">meta_ty_name</span></a></span><span>
</span><span id="line-327"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127152"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681127152"><span class="hs-identifier hs-var">zonked_q_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Utils.Zonk.html#zonkTopLExpr"><span class="hs-identifier hs-var">zonkTopLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsExpr GhcTc -&gt; TcM (LHsExpr GhcTc))
-&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span>
</span><span id="line-328"></span><span>                            </span><span class="annot"><span class="annottext">SpliceType -&gt; TcM (LHsExpr GhcTc) -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Splice.html#tcTopSpliceExpr"><span class="hs-identifier hs-var">tcTopSpliceExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceType
</span><a href="GHC.Tc.Types.html#Untyped"><span class="hs-identifier hs-var">Untyped</span></a></span><span>
</span><span id="line-329"></span><span>                              </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed) -&gt; Type -&gt; TcM (LHsExpr GhcTc)
</span><a href="GHC.Tc.Gen.Expr.html#tcCheckPolyExpr"><span class="hs-identifier hs-var">tcCheckPolyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127160"><span class="hs-identifier hs-var">the_expr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681127154"><span class="hs-identifier hs-var">meta_exp_ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-330"></span><span>
</span><span id="line-331"></span><span>             </span><span class="hs-comment">-- Run the expression</span><span>
</span><span id="line-332"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127149"><span class="annot"><span class="annottext">TcRef [ForeignRef (Q ())]
</span><a href="#local-6989586621681127149"><span class="hs-identifier hs-var">mod_finalizers_ref</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())]
-&gt; TcRnIf TcGblEnv TcLclEnv (TcRef [ForeignRef (Q ())])
forall a gbl lcl. a -&gt; TcRnIf gbl lcl (TcRef a)
</span><a href="GHC.Tc.Utils.Monad.html#newTcRef"><span class="hs-identifier hs-var">newTcRef</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-333"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127147"><span class="annot"><span class="annottext">res
</span><a href="#local-6989586621681127147"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ThStage -&gt; TcRn res -&gt; TcRn res
forall a. ThStage -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#setStage"><span class="hs-identifier hs-var">setStage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcRef [ForeignRef (Q ())] -&gt; ThStage
</span><a href="GHC.Tc.Types.html#RunSplice"><span class="hs-identifier hs-var">RunSplice</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef [ForeignRef (Q ())]
</span><a href="#local-6989586621681127149"><span class="hs-identifier hs-var">mod_finalizers_ref</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcRn res -&gt; TcRn res) -&gt; TcRn res -&gt; TcRn res
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-334"></span><span>                     </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; TcRn res
</span><a href="#local-6989586621681127166"><span class="hs-identifier hs-var">run_meta</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681127152"><span class="hs-identifier hs-var">zonked_q_expr</span></a></span><span>
</span><span id="line-335"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127146"><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127146"><span class="hs-identifier hs-var">mod_finalizers</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRef [ForeignRef (Q ())]
-&gt; TcRnIf TcGblEnv TcLclEnv [ForeignRef (Q ())]
forall a gbl lcl. TcRef a -&gt; TcRnIf gbl lcl a
</span><a href="GHC.Tc.Utils.Monad.html#readTcRef"><span class="hs-identifier hs-var">readTcRef</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef [ForeignRef (Q ())]
</span><a href="#local-6989586621681127149"><span class="hs-identifier hs-var">mod_finalizers_ref</span></a></span><span>
</span><span id="line-336"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">SpliceInfo -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#traceSplice"><span class="hs-identifier hs-var">traceSplice</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SpliceInfo :: String
-&gt; Maybe (LHsExpr (GhcPass 'Renamed))
-&gt; Bool
-&gt; MsgDoc
-&gt; SpliceInfo
</span><a href="GHC.Rename.Splice.html#SpliceInfo"><span class="hs-identifier hs-type">SpliceInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">spliceDescription :: String
</span><a href="GHC.Rename.Splice.html#spliceDescription"><span class="hs-identifier hs-var">spliceDescription</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681127142"><span class="hs-identifier hs-var">what</span></a></span><span>
</span><span id="line-337"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spliceIsDecl :: Bool
</span><a href="GHC.Rename.Splice.html#spliceIsDecl"><span class="hs-identifier hs-var">spliceIsDecl</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681127140"><span class="hs-identifier hs-var">is_decl</span></a></span><span>
</span><span id="line-338"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spliceSource :: Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="GHC.Rename.Splice.html#spliceSource"><span class="hs-identifier hs-var">spliceSource</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed) -&gt; Maybe (LHsExpr (GhcPass 'Renamed))
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127160"><span class="hs-identifier hs-var">the_expr</span></a></span><span>
</span><span id="line-339"></span><span>                                 </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spliceGenerated :: MsgDoc
</span><a href="GHC.Rename.Splice.html#spliceGenerated"><span class="hs-identifier hs-var">spliceGenerated</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">res -&gt; MsgDoc
</span><a href="#local-6989586621681127165"><span class="hs-identifier hs-var">ppr_res</span></a></span><span> </span><span class="annot"><span class="annottext">res
</span><a href="#local-6989586621681127147"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(res, [ForeignRef (Q ())]) -&gt; TcRn (res, [ForeignRef (Q ())])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">res
</span><a href="#local-6989586621681127147"><span class="hs-identifier hs-var">result</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127146"><span class="hs-identifier hs-var">mod_finalizers</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-342"></span><span>
</span><span id="line-343"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-344"></span><span>    </span><span id="local-6989586621681127153"><span class="annot"><span class="annottext">meta_ty_name :: Name
</span><a href="#local-6989586621681127153"><span class="hs-identifier hs-var hs-var">meta_ty_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127167"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-345"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedExpSplice"><span class="hs-identifier hs-var">UntypedExpSplice</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#expQTyConName"><span class="hs-identifier hs-var">expQTyConName</span></a></span><span>
</span><span id="line-346"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedPatSplice"><span class="hs-identifier hs-var">UntypedPatSplice</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#patQTyConName"><span class="hs-identifier hs-var">patQTyConName</span></a></span><span>
</span><span id="line-347"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedTypeSplice"><span class="hs-identifier hs-var">UntypedTypeSplice</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#typeQTyConName"><span class="hs-identifier hs-var">typeQTyConName</span></a></span><span>
</span><span id="line-348"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedDeclSplice"><span class="hs-identifier hs-var">UntypedDeclSplice</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#decsQTyConName"><span class="hs-identifier hs-var">decsQTyConName</span></a></span><span>
</span><span id="line-349"></span><span>    </span><span id="local-6989586621681127142"><span class="annot"><span class="annottext">what :: String
</span><a href="#local-6989586621681127142"><span class="hs-identifier hs-var hs-var">what</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127167"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-350"></span><span>                  </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedExpSplice"><span class="hs-identifier hs-var">UntypedExpSplice</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;expression&quot;</span></span><span>
</span><span id="line-351"></span><span>                  </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedPatSplice"><span class="hs-identifier hs-var">UntypedPatSplice</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pattern&quot;</span></span><span>
</span><span id="line-352"></span><span>                  </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedTypeSplice"><span class="hs-identifier hs-var">UntypedTypeSplice</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;type&quot;</span></span><span>
</span><span id="line-353"></span><span>                  </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedDeclSplice"><span class="hs-identifier hs-var">UntypedDeclSplice</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;declarations&quot;</span></span><span>
</span><span id="line-354"></span><span>    </span><span id="local-6989586621681127140"><span class="annot"><span class="annottext">is_decl :: Bool
</span><a href="#local-6989586621681127140"><span class="hs-identifier hs-var hs-var">is_decl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127167"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-355"></span><span>                 </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedDeclSplice"><span class="hs-identifier hs-var">UntypedDeclSplice</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-356"></span><span>                 </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><span class="hs-identifier">_</span></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">------------------</span><span>
</span><span id="line-359"></span><span class="annot"><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-type">makePending</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#UntypedSpliceFlavour"><span class="hs-identifier hs-type">UntypedSpliceFlavour</span></a></span><span>
</span><span id="line-360"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-361"></span><span>            </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-type">PendingRnSplice</span></a></span><span>
</span><span id="line-362"></span><span id="makePending"><span class="annot"><span class="annottext">makePending :: UntypedSpliceFlavour
-&gt; HsSplice (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var hs-var">makePending</span></a></span></span><span> </span><span id="local-6989586621681127132"><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127132"><span class="hs-identifier hs-var">flavour</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsUntypedSplice"><span class="hs-identifier hs-type">HsUntypedSplice</span></a></span><span> </span><span class="annot"><span class="annottext">XUntypedSplice (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">SpliceDecoration
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681127131"><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127131"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681127130"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127130"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; Name -&gt; LHsExpr (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-var">PendingRnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127132"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127131"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127130"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-364"></span><span class="annot"><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var">makePending</span></a></span><span> </span><span id="local-6989586621681127128"><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127128"><span class="hs-identifier hs-var">flavour</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsQuasiQuote"><span class="hs-identifier hs-type">HsQuasiQuote</span></a></span><span> </span><span class="annot"><span class="annottext">XQuasiQuote (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681127127"><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127127"><span class="hs-identifier hs-var">n</span></a></span></span><span> </span><span id="local-6989586621681127126"><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127126"><span class="hs-identifier hs-var">quoter</span></a></span></span><span> </span><span id="local-6989586621681127125"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127125"><span class="hs-identifier hs-var">q_span</span></a></span></span><span> </span><span id="local-6989586621681127124"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127124"><span class="hs-identifier hs-var">quote</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-365"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; Name -&gt; LHsExpr (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-var">PendingRnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127128"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127127"><span class="hs-identifier hs-var">n</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; Name -&gt; SrcSpan -&gt; FastString -&gt; LHsExpr (GhcPass 'Renamed)
</span><a href="GHC.Rename.Splice.html#mkQuasiQuoteExpr"><span class="hs-identifier hs-var">mkQuasiQuoteExpr</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127128"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127126"><span class="hs-identifier hs-var">quoter</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127125"><span class="hs-identifier hs-var">q_span</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127124"><span class="hs-identifier hs-var">quote</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-366"></span><span class="annot"><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var">makePending</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681127123"><span class="annot"><span class="annottext">splice :: HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127123"><span class="hs-identifier hs-var">splice</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsTypedSplice"><span class="hs-identifier hs-type">HsTypedSplice</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; PendingRnSplice
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;makePending&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127123"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-368"></span><span class="annot"><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var">makePending</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681127122"><span class="annot"><span class="annottext">splice :: HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127122"><span class="hs-identifier hs-var">splice</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-369"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; PendingRnSplice
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;makePending&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127122"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-370"></span><span>
</span><span id="line-371"></span><span class="hs-comment">------------------</span><span>
</span><span id="line-372"></span><span class="annot"><a href="GHC.Rename.Splice.html#mkQuasiQuoteExpr"><span class="hs-identifier hs-type">mkQuasiQuoteExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#UntypedSpliceFlavour"><span class="hs-identifier hs-type">UntypedSpliceFlavour</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html#FastString"><span class="hs-identifier hs-type">FastString</span></a></span><span>
</span><span id="line-373"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span>
</span><span id="line-374"></span><span class="hs-comment">-- Return the expression (quoter &quot;...quote...&quot;)</span><span>
</span><span id="line-375"></span><span class="hs-comment">-- which is what we must run in a quasi-quote</span><span>
</span><span id="line-376"></span><span id="mkQuasiQuoteExpr"><span class="annot"><span class="annottext">mkQuasiQuoteExpr :: UntypedSpliceFlavour
-&gt; Name -&gt; SrcSpan -&gt; FastString -&gt; LHsExpr (GhcPass 'Renamed)
</span><a href="GHC.Rename.Splice.html#mkQuasiQuoteExpr"><span class="hs-identifier hs-var hs-var">mkQuasiQuoteExpr</span></a></span></span><span> </span><span id="local-6989586621681127121"><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127121"><span class="hs-identifier hs-var">flavour</span></a></span></span><span> </span><span id="local-6989586621681127120"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127120"><span class="hs-identifier hs-var">quoter</span></a></span></span><span> </span><span id="local-6989586621681127119"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span></span><span> </span><span id="local-6989586621681127118"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127118"><span class="hs-identifier hs-var">quote</span></a></span></span><span>
</span><span id="line-377"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed))
-&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XApp (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed)
-&gt; HsExpr (GhcPass 'Renamed)
forall p. XApp p -&gt; LHsExpr p -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsApp"><span class="hs-identifier hs-var">HsApp</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XApp (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span><span>
</span><span id="line-378"></span><span>             </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed))
-&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XApp (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed)
-&gt; HsExpr (GhcPass 'Renamed)
forall p. XApp p -&gt; LHsExpr p -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsApp"><span class="hs-identifier hs-var">HsApp</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XApp (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XVar (GhcPass 'Renamed)
-&gt; Located (IdP (GhcPass 'Renamed)) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XVar p -&gt; Located (IdP p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsVar"><span class="hs-identifier hs-var">HsVar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XVar (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; GenLocated SrcSpan Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127114"><span class="hs-identifier hs-var">quote_selector</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span>                                </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127113"><span class="hs-identifier hs-var">quoterExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-380"></span><span>                    </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127112"><span class="hs-identifier hs-var">quoteExpr</span></a></span><span>
</span><span id="line-381"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-382"></span><span>    </span><span id="local-6989586621681127113"><span class="annot"><span class="annottext">quoterExpr :: LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127113"><span class="hs-identifier hs-var hs-var">quoterExpr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed))
-&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">XVar (GhcPass 'Renamed)
-&gt; Located (IdP (GhcPass 'Renamed)) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XVar p -&gt; Located (IdP p) -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsVar"><span class="hs-identifier hs-var">HsVar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XVar (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan Name -&gt; HsExpr (GhcPass 'Renamed))
-&gt; GenLocated SrcSpan Name -&gt; HsExpr (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; GenLocated SrcSpan Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127120"><span class="hs-identifier hs-var">quoter</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>    </span><span id="local-6989586621681127112"><span class="annot"><span class="annottext">quoteExpr :: LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127112"><span class="hs-identifier hs-var hs-var">quoteExpr</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127119"><span class="hs-identifier hs-var">q_span</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed))
-&gt; HsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">XLitE (GhcPass 'Renamed)
-&gt; HsLit (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XLitE p -&gt; HsLit p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsLit"><span class="hs-identifier hs-var">HsLit</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XLitE (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">(HsLit (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed))
-&gt; HsLit (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24%21"><span class="hs-operator hs-var">$!</span></a></span><span> </span><span class="annot"><span class="annottext">XHsString (GhcPass 'Renamed)
-&gt; FastString -&gt; HsLit (GhcPass 'Renamed)
forall x. XHsString x -&gt; FastString -&gt; HsLit x
</span><a href="GHC.Hs.Lit.html#HsString"><span class="hs-identifier hs-var">HsString</span></a></span><span> </span><span class="annot"><span class="annottext">SourceText
XHsString (GhcPass 'Renamed)
</span><a href="GHC.Types.Basic.html#NoSourceText"><span class="hs-identifier hs-var">NoSourceText</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127118"><span class="hs-identifier hs-var">quote</span></a></span><span>
</span><span id="line-384"></span><span>    </span><span id="local-6989586621681127114"><span class="annot"><span class="annottext">quote_selector :: Name
</span><a href="#local-6989586621681127114"><span class="hs-identifier hs-var hs-var">quote_selector</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="#local-6989586621681127121"><span class="hs-identifier hs-var">flavour</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-385"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedExpSplice"><span class="hs-identifier hs-var">UntypedExpSplice</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#quoteExpName"><span class="hs-identifier hs-var">quoteExpName</span></a></span><span>
</span><span id="line-386"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedPatSplice"><span class="hs-identifier hs-var">UntypedPatSplice</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#quotePatName"><span class="hs-identifier hs-var">quotePatName</span></a></span><span>
</span><span id="line-387"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedTypeSplice"><span class="hs-identifier hs-var">UntypedTypeSplice</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#quoteTypeName"><span class="hs-identifier hs-var">quoteTypeName</span></a></span><span>
</span><span id="line-388"></span><span>                       </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedDeclSplice"><span class="hs-identifier hs-var">UntypedDeclSplice</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.TH.html#quoteDecName"><span class="hs-identifier hs-var">quoteDecName</span></a></span><span>
</span><span id="line-389"></span><span>
</span><span id="line-390"></span><span class="hs-comment">---------------------</span><span>
</span><span id="line-391"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-type">rnSplice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-392"></span><span class="hs-comment">-- Not exported...used for all</span><span>
</span><span id="line-393"></span><span id="rnSplice"><span class="annot"><span class="annottext">rnSplice :: HsSplice GhcPs -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var hs-var">rnSplice</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsTypedSplice"><span class="hs-identifier hs-type">HsTypedSplice</span></a></span><span> </span><span id="local-6989586621681127107"><span class="annot"><span class="annottext">XTypedSplice GhcPs
</span><a href="#local-6989586621681127107"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127106"><span class="annot"><span class="annottext">SpliceDecoration
</span><a href="#local-6989586621681127106"><span class="hs-identifier hs-var">hasParen</span></a></span></span><span> </span><span id="local-6989586621681127105"><span class="annot"><span class="annottext">IdP GhcPs
</span><a href="#local-6989586621681127105"><span class="hs-identifier hs-var">splice_name</span></a></span></span><span> </span><span id="local-6989586621681127104"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127104"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-394"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127103"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127103"><span class="hs-identifier hs-var">loc</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn SrcSpan
</span><a href="GHC.Tc.Utils.Monad.html#getSrcSpanM"><span class="hs-identifier hs-var">getSrcSpanM</span></a></span><span>
</span><span id="line-395"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127101"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127101"><span class="hs-identifier hs-var">n'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier hs-var">newLocalBndrRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; RdrName -&gt; Located RdrName
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127103"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
IdP GhcPs
</span><a href="#local-6989586621681127105"><span class="hs-identifier hs-var">splice_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-396"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127100"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127100"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127099"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127099"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127104"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-397"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XTypedSplice (GhcPass 'Renamed)
-&gt; SpliceDecoration
-&gt; IdP (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed)
forall id.
XTypedSplice id
-&gt; SpliceDecoration -&gt; IdP id -&gt; LHsExpr id -&gt; HsSplice id
</span><a href="GHC.Hs.Expr.html#HsTypedSplice"><span class="hs-identifier hs-var">HsTypedSplice</span></a></span><span> </span><span class="annot"><span class="annottext">XTypedSplice GhcPs
XTypedSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127107"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceDecoration
</span><a href="#local-6989586621681127106"><span class="hs-identifier hs-var">hasParen</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127101"><span class="hs-identifier hs-var">n'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127100"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127099"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-398"></span><span>
</span><span id="line-399"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var">rnSplice</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsUntypedSplice"><span class="hs-identifier hs-type">HsUntypedSplice</span></a></span><span> </span><span id="local-6989586621681127098"><span class="annot"><span class="annottext">XUntypedSplice GhcPs
</span><a href="#local-6989586621681127098"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127097"><span class="annot"><span class="annottext">SpliceDecoration
</span><a href="#local-6989586621681127097"><span class="hs-identifier hs-var">hasParen</span></a></span></span><span> </span><span id="local-6989586621681127096"><span class="annot"><span class="annottext">IdP GhcPs
</span><a href="#local-6989586621681127096"><span class="hs-identifier hs-var">splice_name</span></a></span></span><span> </span><span id="local-6989586621681127095"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127095"><span class="hs-identifier hs-var">expr</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-400"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127094"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127094"><span class="hs-identifier hs-var">loc</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn SrcSpan
</span><a href="GHC.Tc.Utils.Monad.html#getSrcSpanM"><span class="hs-identifier hs-var">getSrcSpanM</span></a></span><span>
</span><span id="line-401"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127093"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127093"><span class="hs-identifier hs-var">n'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier hs-var">newLocalBndrRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; RdrName -&gt; Located RdrName
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127094"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
IdP GhcPs
</span><a href="#local-6989586621681127096"><span class="hs-identifier hs-var">splice_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-402"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127092"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127092"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127091"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127091"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127095"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-403"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XUntypedSplice (GhcPass 'Renamed)
-&gt; SpliceDecoration
-&gt; IdP (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed)
forall id.
XUntypedSplice id
-&gt; SpliceDecoration -&gt; IdP id -&gt; LHsExpr id -&gt; HsSplice id
</span><a href="GHC.Hs.Expr.html#HsUntypedSplice"><span class="hs-identifier hs-var">HsUntypedSplice</span></a></span><span> </span><span class="annot"><span class="annottext">XUntypedSplice GhcPs
XUntypedSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127098"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceDecoration
</span><a href="#local-6989586621681127097"><span class="hs-identifier hs-var">hasParen</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127093"><span class="hs-identifier hs-var">n'</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127092"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127091"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-404"></span><span>
</span><span id="line-405"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var">rnSplice</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsQuasiQuote"><span class="hs-identifier hs-type">HsQuasiQuote</span></a></span><span> </span><span id="local-6989586621681127090"><span class="annot"><span class="annottext">XQuasiQuote GhcPs
</span><a href="#local-6989586621681127090"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span id="local-6989586621681127089"><span class="annot"><span class="annottext">IdP GhcPs
</span><a href="#local-6989586621681127089"><span class="hs-identifier hs-var">splice_name</span></a></span></span><span> </span><span id="local-6989586621681127088"><span class="annot"><span class="annottext">IdP GhcPs
</span><a href="#local-6989586621681127088"><span class="hs-identifier hs-var">quoter</span></a></span></span><span> </span><span id="local-6989586621681127087"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127087"><span class="hs-identifier hs-var">q_loc</span></a></span></span><span> </span><span id="local-6989586621681127086"><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127086"><span class="hs-identifier hs-var">quote</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-406"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681127085"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127085"><span class="hs-identifier hs-var">loc</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn SrcSpan
</span><a href="GHC.Tc.Utils.Monad.html#getSrcSpanM"><span class="hs-identifier hs-var">getSrcSpanM</span></a></span><span>
</span><span id="line-407"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127084"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127084"><span class="hs-identifier hs-var">splice_name'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Located RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Utils.html#newLocalBndrRn"><span class="hs-identifier hs-var">newLocalBndrRn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; RdrName -&gt; Located RdrName
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127085"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
IdP GhcPs
</span><a href="#local-6989586621681127089"><span class="hs-identifier hs-var">splice_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-408"></span><span>
</span><span id="line-409"></span><span>          </span><span class="hs-comment">-- Rename the quoter; akin to the HsVar case of rnExpr</span><span>
</span><span id="line-410"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127083"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127083"><span class="hs-identifier hs-var">quoter'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RdrName -&gt; RnM Name
</span><a href="GHC.Rename.Env.html#lookupOccRn"><span class="hs-identifier hs-var">lookupOccRn</span></a></span><span> </span><span class="annot"><span class="annottext">RdrName
IdP GhcPs
</span><a href="#local-6989586621681127088"><span class="hs-identifier hs-var">quoter</span></a></span><span>
</span><span id="line-411"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127082"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681127082"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-412"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; Name -&gt; Bool
</span><a href="GHC.Types.Name.html#nameIsLocalOrFrom"><span class="hs-identifier hs-var">nameIsLocalOrFrom</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681127082"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127083"><span class="hs-identifier hs-var">quoter'</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-413"></span><span>          </span><span class="annot"><span class="annottext">Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#checkThLocalName"><span class="hs-identifier hs-var">checkThLocalName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127083"><span class="hs-identifier hs-var">quoter'</span></a></span><span>
</span><span id="line-414"></span><span>
</span><span id="line-415"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XQuasiQuote (GhcPass 'Renamed)
-&gt; IdP (GhcPass 'Renamed)
-&gt; IdP (GhcPass 'Renamed)
-&gt; SrcSpan
-&gt; FastString
-&gt; HsSplice (GhcPass 'Renamed)
forall id.
XQuasiQuote id
-&gt; IdP id -&gt; IdP id -&gt; SrcSpan -&gt; FastString -&gt; HsSplice id
</span><a href="GHC.Hs.Expr.html#HsQuasiQuote"><span class="hs-identifier hs-var">HsQuasiQuote</span></a></span><span> </span><span class="annot"><span class="annottext">XQuasiQuote GhcPs
XQuasiQuote (GhcPass 'Renamed)
</span><a href="#local-6989586621681127090"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127084"><span class="hs-identifier hs-var">splice_name'</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681127083"><span class="hs-identifier hs-var">quoter'</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127087"><span class="hs-identifier hs-var">q_loc</span></a></span><span> </span><span class="annot"><span class="annottext">FastString
</span><a href="#local-6989586621681127086"><span class="hs-identifier hs-var">quote</span></a></span><span>
</span><span id="line-416"></span><span>                                                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#unitFV"><span class="hs-identifier hs-var">unitFV</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681127083"><span class="hs-identifier hs-var">quoter'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-417"></span><span>
</span><span id="line-418"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var">rnSplice</span></a></span><span> </span><span id="local-6989586621681127081"><span class="annot"><span class="annottext">splice :: HsSplice GhcPs
</span><a href="#local-6989586621681127081"><span class="hs-identifier hs-var">splice</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnSplice&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127081"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>
</span><span id="line-420"></span><span class="hs-comment">---------------------</span><span>
</span><span id="line-421"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSpliceExpr"><span class="hs-identifier hs-type">rnSpliceExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span id="rnSpliceExpr"><span class="annot"><span class="annottext">rnSpliceExpr :: HsSplice GhcPs -&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceExpr"><span class="hs-identifier hs-var hs-var">rnSpliceExpr</span></a></span></span><span> </span><span id="local-6989586621681127080"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127080"><span class="hs-identifier hs-var">splice</span></a></span></span><span>
</span><span id="line-423"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed)
 -&gt; RnM (HsExpr (GhcPass 'Renamed), Uses))
-&gt; (HsSplice (GhcPass 'Renamed)
    -&gt; (PendingRnSplice, HsExpr (GhcPass 'Renamed)))
-&gt; HsSplice GhcPs
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
forall a.
(HsSplice (GhcPass 'Renamed) -&gt; RnM (a, Uses))
-&gt; (HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a))
-&gt; HsSplice GhcPs
-&gt; RnM (a, Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceGen"><span class="hs-identifier hs-var">rnSpliceGen</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
</span><a href="#local-6989586621681127079"><span class="hs-identifier hs-var">run_expr_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, HsExpr (GhcPass 'Renamed))
</span><a href="#local-6989586621681127078"><span class="hs-identifier hs-var">pend_expr_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127080"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-424"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-425"></span><span>    </span><span class="annot"><a href="#local-6989586621681127078"><span class="hs-identifier hs-type">pend_expr_splice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-type">PendingRnSplice</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-426"></span><span>    </span><span id="local-6989586621681127078"><span class="annot"><span class="annottext">pend_expr_splice :: HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, HsExpr (GhcPass 'Renamed))
</span><a href="#local-6989586621681127078"><span class="hs-identifier hs-var hs-var">pend_expr_splice</span></a></span></span><span> </span><span id="local-6989586621681127077"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127077"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>
</span><span id="line-427"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; HsSplice (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var">makePending</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedExpSplice"><span class="hs-identifier hs-var">UntypedExpSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127077"><span class="hs-identifier hs-var">rn_splice</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">XSpliceE (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XSpliceE p -&gt; HsSplice p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsSpliceE"><span class="hs-identifier hs-var">HsSpliceE</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliceE (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127077"><span class="hs-identifier hs-var">rn_splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-428"></span><span>
</span><span id="line-429"></span><span>    </span><span class="annot"><a href="#local-6989586621681127079"><span class="hs-identifier hs-type">run_expr_splice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#HsExpr"><span class="hs-identifier hs-type">HsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-430"></span><span>    </span><span id="local-6989586621681127079"><span class="annot"><span class="annottext">run_expr_splice :: HsSplice (GhcPass 'Renamed)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
</span><a href="#local-6989586621681127079"><span class="hs-identifier hs-var hs-var">run_expr_splice</span></a></span></span><span> </span><span id="local-6989586621681127075"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127075"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>
</span><span id="line-431"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed) -&gt; Bool
forall id. HsSplice id -&gt; Bool
</span><a href="GHC.Hs.Expr.html#isTypedSplice"><span class="hs-identifier hs-var">isTypedSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127075"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>   </span><span class="hs-comment">-- Run it later, in the type checker</span><span>
</span><span id="line-432"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>  </span><span class="hs-comment">-- Ugh!  See Note [Splices] above</span><span>
</span><span id="line-433"></span><span>             </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnSpliceExpr: typed expression splice&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-434"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127074"><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681127074"><span class="hs-identifier hs-var">lcl_rdr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RnM LocalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getLocalRdrEnv"><span class="hs-identifier hs-var">getLocalRdrEnv</span></a></span><span>
</span><span id="line-435"></span><span>           </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681127072"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681127072"><span class="hs-identifier hs-var">gbl_rdr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRn GlobalRdrEnv
</span><a href="GHC.Tc.Utils.Monad.html#getGlobalRdrEnv"><span class="hs-identifier hs-var">getGlobalRdrEnv</span></a></span><span>
</span><span id="line-436"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681127070"><span class="annot"><span class="annottext">gbl_names :: Uses
</span><a href="#local-6989586621681127070"><span class="hs-identifier hs-var hs-var">gbl_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Name
</span><a href="GHC.Types.Name.Reader.html#gre_name"><span class="hs-identifier hs-var hs-var">gre_name</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681127067"><span class="hs-identifier hs-var">gre</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681127067"><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681127067"><span class="hs-identifier hs-var">gre</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv -&gt; [GlobalRdrElt]
</span><a href="GHC.Types.Name.Reader.html#globalRdrEnvElts"><span class="hs-identifier hs-var">globalRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681127072"><span class="hs-identifier hs-var">gbl_rdr</span></a></span><span>
</span><span id="line-437"></span><span>                                                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt -&gt; Bool
</span><a href="GHC.Types.Name.Reader.html#isLocalGRE"><span class="hs-identifier hs-var">isLocalGRE</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrElt
</span><a href="#local-6989586621681127067"><span class="hs-identifier hs-var">gre</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-438"></span><span>                 </span><span id="local-6989586621681127064"><span class="annot"><span class="annottext">lcl_names :: Uses
</span><a href="#local-6989586621681127064"><span class="hs-identifier hs-var hs-var">lcl_names</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Name] -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#mkNameSet"><span class="hs-identifier hs-var">mkNameSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalRdrEnv -&gt; [Name]
</span><a href="GHC.Types.Name.Reader.html#localRdrEnvElts"><span class="hs-identifier hs-var">localRdrEnvElts</span></a></span><span> </span><span class="annot"><span class="annottext">LocalRdrEnv
</span><a href="#local-6989586621681127074"><span class="hs-identifier hs-var">lcl_rdr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-439"></span><span>
</span><span id="line-440"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed), Uses)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XSpliceE (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XSpliceE p -&gt; HsSplice p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsSpliceE"><span class="hs-identifier hs-var">HsSpliceE</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliceE (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127075"><span class="hs-identifier hs-var">rn_splice</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127064"><span class="hs-identifier hs-var">lcl_names</span></a></span><span> </span><span class="annot"><span class="annottext">Uses -&gt; Uses -&gt; Uses
</span><a href="GHC.Types.Name.Set.html#plusFV"><span class="hs-operator hs-var">`plusFV`</span></a></span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127070"><span class="hs-identifier hs-var">gbl_names</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-comment">-- Run it here, see Note [Running splices in the Renamer]</span><span>
</span><span id="line-443"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnSpliceExpr: untyped expression splice&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-444"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127062"><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127062"><span class="hs-identifier hs-var">rn_expr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127061"><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127061"><span class="hs-identifier hs-var">mod_finalizers</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-445"></span><span>                </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn (LHsExpr GhcPs))
-&gt; (LHsExpr GhcPs -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (LHsExpr GhcPs, [ForeignRef (Q ())])
forall res.
UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn res)
-&gt; (res -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (res, [ForeignRef (Q ())])
</span><a href="GHC.Rename.Splice.html#runRnSplice"><span class="hs-identifier hs-var">runRnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedExpSplice"><span class="hs-identifier hs-var">UntypedExpSplice</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; TcRn (LHsExpr GhcPs)
</span><a href="GHC.Tc.Gen.Splice.html#runMetaE"><span class="hs-identifier hs-var">runMetaE</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127075"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>
</span><span id="line-446"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127060"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127060"><span class="hs-identifier hs-var">lexpr3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127059"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127059"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">RnM (LHsExpr (GhcPass 'Renamed), Uses)
-&gt; RnM (LHsExpr (GhcPass 'Renamed), Uses)
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr GhcPs -&gt; RnM (LHsExpr (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Expr.html#rnLExpr"><span class="hs-identifier hs-var">rnLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcPs
</span><a href="#local-6989586621681127062"><span class="hs-identifier hs-var">rn_expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-447"></span><span>             </span><span class="hs-comment">-- See Note [Delaying modFinalizers in untyped splices].</span><span>
</span><span id="line-448"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed), Uses)
-&gt; RnM (HsExpr (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">XPar (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XPar p -&gt; LHsExpr p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsPar"><span class="hs-identifier hs-var">HsPar</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XPar (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">(LHsExpr (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed))
-&gt; LHsExpr (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliceE (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed)
forall p. XSpliceE p -&gt; HsSplice p -&gt; HsExpr p
</span><a href="GHC.Hs.Expr.html#HsSpliceE"><span class="hs-identifier hs-var">HsSpliceE</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliceE (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-449"></span><span>                            </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed))
-&gt; (HsExpr (GhcPass 'Renamed) -&gt; HsSplice (GhcPass 'Renamed))
-&gt; HsExpr (GhcPass 'Renamed)
-&gt; HsExpr (GhcPass 'Renamed)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliced (GhcPass 'Renamed)
-&gt; ThModFinalizers
-&gt; HsSplicedThing (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed)
forall id.
XSpliced id -&gt; ThModFinalizers -&gt; HsSplicedThing id -&gt; HsSplice id
</span><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-var">HsSpliced</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliced (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ForeignRef (Q ())] -&gt; ThModFinalizers
</span><a href="GHC.Hs.Expr.html#ThModFinalizers"><span class="hs-identifier hs-var">ThModFinalizers</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127061"><span class="hs-identifier hs-var">mod_finalizers</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-450"></span><span>                            </span><span class="annot"><span class="annottext">(HsSplicedThing (GhcPass 'Renamed) -&gt; HsSplice (GhcPass 'Renamed))
-&gt; (HsExpr (GhcPass 'Renamed) -&gt; HsSplicedThing (GhcPass 'Renamed))
-&gt; HsExpr (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Renamed) -&gt; HsSplicedThing (GhcPass 'Renamed)
forall id. HsExpr id -&gt; HsSplicedThing id
</span><a href="GHC.Hs.Expr.html#HsSplicedExpr"><span class="hs-identifier hs-var">HsSplicedExpr</span></a></span><span> </span><span class="annot"><span class="annottext">(HsExpr (GhcPass 'Renamed) -&gt; HsExpr (GhcPass 'Renamed))
-&gt; LHsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span>
</span><span id="line-451"></span><span>                            </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681127060"><span class="hs-identifier hs-var">lexpr3</span></a></span><span>
</span><span id="line-452"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127059"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-453"></span><span>           </span><span class="hs-special">}</span><span>
</span><span id="line-454"></span><span>
</span><span id="line-455"></span><span class="hs-comment">{- Note [Running splices in the Renamer]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Splices used to be run in the typechecker, which led to (#4364). Since the
renamer must decide which expressions depend on which others, and it cannot
reliably do this for arbitrary splices, we used to conservatively say that
splices depend on all other expressions in scope. Unfortunately, this led to
the problem of cyclic type declarations seen in (#4364). Instead, by
running splices in the renamer, we side-step the problem of determining
dependencies: by the time the dependency analysis happens, any splices have
already been run, and expression dependencies can be determined as usual.

However, see (#9813), for an example where we would like to run splices
*after* performing dependency analysis (that is, after renaming). It would be
desirable to typecheck &quot;non-splicy&quot; expressions (those expressions that do not
contain splices directly or via dependence on an expression that does) before
&quot;splicy&quot; expressions, such that types/expressions within the same declaration
group would be available to `reify` calls, for example consider the following:

&gt; module M where
&gt;   data D = C
&gt;   f = 1
&gt;   g = $(mapM reify ['f, 'D, ''C] ...)

Compilation of this example fails since D/C/f are not in the type environment
and thus cannot be reified as they have not been typechecked by the time the
splice is renamed and thus run.

These requirements are at odds: we do not want to run splices in the renamer as
we wish to first determine dependencies and typecheck certain expressions,
making them available to reify, but cannot accurately determine dependencies
without running splices in the renamer!

Indeed, the conclusion of (#9813) was that it is not worth the complexity
to try and
 a) implement and maintain the code for renaming/typechecking non-splicy
    expressions before splicy expressions,
 b) explain to TH users which expressions are/not available to reify at any
    given point.

-}</span><span>
</span><span id="line-496"></span><span>
</span><span id="line-497"></span><span class="hs-comment">{- Note [Rebindable syntax and Template Haskell]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When processing Template Haskell quotes with Rebindable Syntax (RS) enabled,
there are two possibilities: apply the RS rules to the quotes or don't.

One might expect that with {-# LANGUAGE RebindableSyntax #-} at the top of a
module, any 'if' expression would end up being turned into a call to whatever
'ifThenElse' function is in scope, regardless of whether the said if expression
appears in &quot;normal&quot; Haskell code or in a TH quote. This however comes with its
problems. Consider the following code:

  {-# LANGUAGE TemplateHaskell, RebindableSyntax #-}

  module X where

  import Prelude ( Monad(..), Bool(..), print, ($) )
  import Language.Haskell.TH.Syntax

  $( do stuff &lt;- [| if True then 10 else 15 |]
        runIO $ print stuff
        return [] )

If we apply the RS rules, then GHC would complain about not having suitable
fromInteger/ifThenElse functions in scope. But this quote is just a bit of
Haskell syntax that has yet to be used, or, to put it differently, placed
(spliced) in some context where the said functions might be available. More
generally, untyped TH quotes are meant to work with yet-unbound identifiers.
This tends to show that untyped TH and Rebindable Syntax overall don't play
well together. Users still have the option to splice &quot;normal&quot; if expressions
into modules where RS is enabled, to turn them into applications of
an 'ifThenElse' function of their choice.

Typed TH (TTH) quotes, on the other hand, come with different constraints. They
don't quite have this &quot;delayed&quot; nature: we typecheck them while processing
them, and TTH users expect RS to Just Work in their quotes, exactly like it does
outside of the quotes. There, we do not have to accept unbound identifiers and
we can apply the RS rules both in the typechecking and desugaring of the quotes
without triggering surprising/bad behaviour for users. For instance, the
following code is expected to be rejected (because of the lack of suitable
'fromInteger'/'ifThenElse' functions in scope):

  {-# LANGUAGE TemplateHaskell, RebindableSyntax #-}

  module X where

  import Prelude ( Monad(..), Bool(..), print, ($) )
  import Language.Haskell.TH.Syntax

  $$( do stuff &lt;- [|| if True then 10 else 15 ||]
         runIO $ print stuff
         return [] )

The conclusion is that even if RS is enabled for a given module, GHC disables it
when processing untyped TH quotes from that module, to avoid the aforementioned
problems, but keeps it on while processing typed TH quotes.

This note and approach originated in #18102.

-}</span><span>
</span><span id="line-557"></span><span>
</span><span id="line-558"></span><span class="hs-comment">{- Note [Delaying modFinalizers in untyped splices]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

When splices run in the renamer, 'reify' does not have access to the local
type environment (#11832, [1]).

For instance, in

&gt; let x = e in $(reify (mkName &quot;x&quot;) &gt;&gt;= runIO . print &gt;&gt; [| return () |])

'reify' cannot find @x@, because the local type environment is not yet
populated. To address this, we allow 'reify' execution to be deferred with
'addModFinalizer'.

&gt; let x = e in $(do addModFinalizer (reify (mkName &quot;x&quot;) &gt;&gt;= runIO . print)
                    [| return () |]
                )

The finalizer is run with the local type environment when type checking is
complete.

Since the local type environment is not available in the renamer, we annotate
the tree at the splice point [2] with @HsSpliceE (HsSpliced finalizers e)@ where
@e@ is the result of splicing and @finalizers@ are the finalizers that have been
collected during evaluation of the splice [3]. In our example,

&gt; HsLet
&gt;   (x = e)
&gt;   (HsSpliceE $ HsSpliced [reify (mkName &quot;x&quot;) &gt;&gt;= runIO . print]
&gt;                          (HsSplicedExpr $ return ())
&gt;   )

When the typechecker finds the annotation, it inserts the finalizers in the
global environment and exposes the current local environment to them [4, 5, 6].

&gt; addModFinalizersWithLclEnv [reify (mkName &quot;x&quot;) &gt;&gt;= runIO . print]

References:

[1] https://gitlab.haskell.org/ghc/ghc/wikis/template-haskell/reify
[2] 'rnSpliceExpr'
[3] 'GHC.Tc.Gen.Splice.qAddModFinalizer'
[4] 'GHC.Tc.Gen.Expr.tcExpr' ('HsSpliceE' ('HsSpliced' ...))
[5] 'GHC.Tc.Gen.HsType.tc_hs_type' ('HsSpliceTy' ('HsSpliced' ...))
[6] 'GHC.Tc.Gen.Pat.tc_pat' ('SplicePat' ('HsSpliced' ...))

-}</span><span>
</span><span id="line-605"></span><span>
</span><span id="line-606"></span><span class="hs-comment">----------------------</span><span>
</span><span id="line-607"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSpliceType"><span class="hs-identifier hs-type">rnSpliceType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Type.html#HsType"><span class="hs-identifier hs-type">HsType</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-608"></span><span id="rnSpliceType"><span class="annot"><span class="annottext">rnSpliceType :: HsSplice GhcPs -&gt; RnM (HsType (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceType"><span class="hs-identifier hs-var hs-var">rnSpliceType</span></a></span></span><span> </span><span id="local-6989586621681127053"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127053"><span class="hs-identifier hs-var">splice</span></a></span></span><span>
</span><span id="line-609"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed)
 -&gt; RnM (HsType (GhcPass 'Renamed), Uses))
-&gt; (HsSplice (GhcPass 'Renamed)
    -&gt; (PendingRnSplice, HsType (GhcPass 'Renamed)))
-&gt; HsSplice GhcPs
-&gt; RnM (HsType (GhcPass 'Renamed), Uses)
forall a.
(HsSplice (GhcPass 'Renamed) -&gt; RnM (a, Uses))
-&gt; (HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a))
-&gt; HsSplice GhcPs
-&gt; RnM (a, Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceGen"><span class="hs-identifier hs-var">rnSpliceGen</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; RnM (HsType (GhcPass 'Renamed), Uses)
</span><a href="#local-6989586621681127052"><span class="hs-identifier hs-var">run_type_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, HsType (GhcPass 'Renamed))
</span><a href="#local-6989586621681127051"><span class="hs-identifier hs-var">pend_type_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127053"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-610"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-611"></span><span>    </span><span id="local-6989586621681127051"><span class="annot"><span class="annottext">pend_type_splice :: HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, HsType (GhcPass 'Renamed))
</span><a href="#local-6989586621681127051"><span class="hs-identifier hs-var hs-var">pend_type_splice</span></a></span></span><span> </span><span id="local-6989586621681127050"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127050"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>
</span><span id="line-612"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; HsSplice (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var">makePending</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedTypeSplice"><span class="hs-identifier hs-var">UntypedTypeSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127050"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>
</span><span id="line-613"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">XSpliceTy (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed) -&gt; HsType (GhcPass 'Renamed)
forall pass. XSpliceTy pass -&gt; HsSplice pass -&gt; HsType pass
</span><a href="GHC.Hs.Type.html#HsSpliceTy"><span class="hs-identifier hs-var">HsSpliceTy</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliceTy (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127050"><span class="hs-identifier hs-var">rn_splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span>    </span><span id="local-6989586621681127052"><span class="annot"><span class="annottext">run_type_splice :: HsSplice (GhcPass 'Renamed)
-&gt; RnM (HsType (GhcPass 'Renamed), Uses)
</span><a href="#local-6989586621681127052"><span class="hs-identifier hs-var hs-var">run_type_splice</span></a></span></span><span> </span><span id="local-6989586621681127034"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127034"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>
</span><span id="line-616"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnSpliceType: untyped type splice&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-617"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127033"><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681127033"><span class="hs-identifier hs-var">hs_ty2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127032"><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127032"><span class="hs-identifier hs-var">mod_finalizers</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-618"></span><span>                </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn (LHsType GhcPs))
-&gt; (LHsType GhcPs -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (LHsType GhcPs, [ForeignRef (Q ())])
forall res.
UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn res)
-&gt; (res -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (res, [ForeignRef (Q ())])
</span><a href="GHC.Rename.Splice.html#runRnSplice"><span class="hs-identifier hs-var">runRnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedTypeSplice"><span class="hs-identifier hs-var">UntypedTypeSplice</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; TcRn (LHsType GhcPs)
</span><a href="GHC.Tc.Gen.Splice.html#runMetaT"><span class="hs-identifier hs-var">runMetaT</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127034"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>
</span><span id="line-619"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127031"><span class="annot"><span class="annottext">LHsType (GhcPass 'Renamed)
</span><a href="#local-6989586621681127031"><span class="hs-identifier hs-var">hs_ty3</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127030"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127030"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681127029"><span class="annot"><span class="annottext">doc :: HsDocContext
</span><a href="#local-6989586621681127029"><span class="hs-identifier hs-var hs-var">doc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs -&gt; HsDocContext
</span><a href="GHC.Rename.Utils.html#SpliceTypeCtx"><span class="hs-identifier hs-var">SpliceTypeCtx</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681127033"><span class="hs-identifier hs-var">hs_ty2</span></a></span><span>
</span><span id="line-620"></span><span>                                 </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">RnM (LHsType (GhcPass 'Renamed), Uses)
-&gt; RnM (LHsType (GhcPass 'Renamed), Uses)
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(RnM (LHsType (GhcPass 'Renamed), Uses)
 -&gt; RnM (LHsType (GhcPass 'Renamed), Uses))
-&gt; RnM (LHsType (GhcPass 'Renamed), Uses)
-&gt; RnM (LHsType (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
-&gt; LHsType GhcPs -&gt; RnM (LHsType (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.HsType.html#rnLHsType"><span class="hs-identifier hs-var">rnLHsType</span></a></span><span> </span><span class="annot"><span class="annottext">HsDocContext
</span><a href="#local-6989586621681127029"><span class="hs-identifier hs-var">doc</span></a></span><span> </span><span class="annot"><span class="annottext">LHsType GhcPs
</span><a href="#local-6989586621681127033"><span class="hs-identifier hs-var">hs_ty2</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-621"></span><span>                                    </span><span class="hs-comment">-- checkNoErrs: see Note [Renamer errors]</span><span>
</span><span id="line-622"></span><span>             </span><span class="hs-comment">-- See Note [Delaying modFinalizers in untyped splices].</span><span>
</span><span id="line-623"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(HsType (GhcPass 'Renamed), Uses)
-&gt; RnM (HsType (GhcPass 'Renamed), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">XParTy (GhcPass 'Renamed)
-&gt; LHsType (GhcPass 'Renamed) -&gt; HsType (GhcPass 'Renamed)
forall pass. XParTy pass -&gt; LHsType pass -&gt; HsType pass
</span><a href="GHC.Hs.Type.html#HsParTy"><span class="hs-identifier hs-var">HsParTy</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XParTy (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-624"></span><span>                              </span><span class="annot"><span class="annottext">(LHsType (GhcPass 'Renamed) -&gt; HsType (GhcPass 'Renamed))
-&gt; LHsType (GhcPass 'Renamed) -&gt; HsType (GhcPass 'Renamed)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliceTy (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed) -&gt; HsType (GhcPass 'Renamed)
forall pass. XSpliceTy pass -&gt; HsSplice pass -&gt; HsType pass
</span><a href="GHC.Hs.Type.html#HsSpliceTy"><span class="hs-identifier hs-var">HsSpliceTy</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliceTy (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-625"></span><span>                              </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed) -&gt; HsType (GhcPass 'Renamed))
-&gt; (HsType (GhcPass 'Renamed) -&gt; HsSplice (GhcPass 'Renamed))
-&gt; HsType (GhcPass 'Renamed)
-&gt; HsType (GhcPass 'Renamed)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliced (GhcPass 'Renamed)
-&gt; ThModFinalizers
-&gt; HsSplicedThing (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed)
forall id.
XSpliced id -&gt; ThModFinalizers -&gt; HsSplicedThing id -&gt; HsSplice id
</span><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-var">HsSpliced</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliced (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ForeignRef (Q ())] -&gt; ThModFinalizers
</span><a href="GHC.Hs.Expr.html#ThModFinalizers"><span class="hs-identifier hs-var">ThModFinalizers</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127032"><span class="hs-identifier hs-var">mod_finalizers</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-626"></span><span>                              </span><span class="annot"><span class="annottext">(HsSplicedThing (GhcPass 'Renamed) -&gt; HsSplice (GhcPass 'Renamed))
-&gt; (HsType (GhcPass 'Renamed) -&gt; HsSplicedThing (GhcPass 'Renamed))
-&gt; HsType (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed)
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">HsType (GhcPass 'Renamed) -&gt; HsSplicedThing (GhcPass 'Renamed)
forall id. HsType id -&gt; HsSplicedThing id
</span><a href="GHC.Hs.Expr.html#HsSplicedTy"><span class="hs-identifier hs-var">HsSplicedTy</span></a></span><span> </span><span class="annot"><span class="annottext">(HsType (GhcPass 'Renamed) -&gt; HsType (GhcPass 'Renamed))
-&gt; LHsType (GhcPass 'Renamed) -&gt; LHsType (GhcPass 'Renamed)
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span>
</span><span id="line-627"></span><span>                              </span><span class="annot"><span class="annottext">LHsType (GhcPass 'Renamed)
</span><a href="#local-6989586621681127031"><span class="hs-identifier hs-var">hs_ty3</span></a></span><span>
</span><span id="line-628"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127030"><span class="hs-identifier hs-var">fvs</span></a></span><span>
</span><span id="line-629"></span><span>                    </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-630"></span><span>              </span><span class="hs-comment">-- Wrap the result of the splice in parens so that we don't</span><span>
</span><span id="line-631"></span><span>              </span><span class="hs-comment">-- lose the outermost location set by runQuasiQuote (#7918)</span><span>
</span><span id="line-632"></span><span>
</span><span id="line-633"></span><span class="hs-comment">{- Note [Partial Type Splices]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Partial Type Signatures are partially supported in TH type splices: only
anonymous wild cards are allowed.

  -- ToDo: SLPJ says: I don't understand all this

Normally, named wild cards are collected before renaming a (partial) type
signature. However, TH type splices are run during renaming, i.e. after the
initial traversal, leading to out of scope errors for named wild cards. We
can't just extend the initial traversal to collect the named wild cards in TH
type splices, as we'd need to expand them, which is supposed to happen only
once, during renaming.

Similarly, the extra-constraints wild card is handled right before renaming
too, and is therefore also not supported in a TH type splice. Another reason
to forbid extra-constraints wild cards in TH type splices is that a single
signature can contain many TH type splices, whereas it mustn't contain more
than one extra-constraints wild card. Enforcing would this be hard the way
things are currently organised.

Anonymous wild cards pose no problem, because they start out without names and
are given names during renaming. These names are collected right after
renaming. The names generated for anonymous wild cards in TH type splices will
thus be collected as well.

For more details about renaming wild cards, see GHC.Rename.HsType.rnHsSigWcType

Note that partial type signatures are fully supported in TH declaration
splices, e.g.:

     [d| foo :: _ =&gt; _
         foo x y = x == y |]

This is because in this case, the partial type signature can be treated as a
whole signature, instead of as an arbitrary type.

-}</span><span>
</span><span id="line-671"></span><span>
</span><span id="line-672"></span><span>
</span><span id="line-673"></span><span class="hs-comment">----------------------</span><span>
</span><span id="line-674"></span><span class="hs-comment">-- | Rename a splice pattern. See Note [rnSplicePat]</span><span>
</span><span id="line-675"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSplicePat"><span class="hs-identifier hs-type">rnSplicePat</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-676"></span><span>                                       </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-677"></span><span id="rnSplicePat"><span class="annot"><span class="annottext">rnSplicePat :: HsSplice GhcPs
-&gt; RnM (Either (Pat GhcPs) (Pat (GhcPass 'Renamed)), Uses)
</span><a href="GHC.Rename.Splice.html#rnSplicePat"><span class="hs-identifier hs-var hs-var">rnSplicePat</span></a></span></span><span> </span><span id="local-6989586621681127025"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127025"><span class="hs-identifier hs-var">splice</span></a></span></span><span>
</span><span id="line-678"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed)
 -&gt; RnM (Either (Pat GhcPs) (Pat (GhcPass 'Renamed)), Uses))
-&gt; (HsSplice (GhcPass 'Renamed)
    -&gt; (PendingRnSplice, Either (Pat GhcPs) (Pat (GhcPass 'Renamed))))
-&gt; HsSplice GhcPs
-&gt; RnM (Either (Pat GhcPs) (Pat (GhcPass 'Renamed)), Uses)
forall a.
(HsSplice (GhcPass 'Renamed) -&gt; RnM (a, Uses))
-&gt; (HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a))
-&gt; HsSplice GhcPs
-&gt; RnM (a, Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceGen"><span class="hs-identifier hs-var">rnSpliceGen</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; RnM (Either (Pat GhcPs) (Pat (GhcPass 'Renamed)), Uses)
</span><a href="#local-6989586621681127024"><span class="hs-identifier hs-var">run_pat_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, Either (Pat GhcPs) (Pat (GhcPass 'Renamed)))
forall b.
HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, Either b (Pat (GhcPass 'Renamed)))
</span><a href="#local-6989586621681127023"><span class="hs-identifier hs-var">pend_pat_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127025"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-679"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-680"></span><span>    </span><span id="local-6989586621681127641"><span class="annot"><a href="#local-6989586621681127023"><span class="hs-identifier hs-type">pend_pat_splice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-681"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-type">PendingRnSplice</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681127641"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span></span><span>
</span><span id="line-682"></span><span>    </span><span id="local-6989586621681127023"><span class="annot"><span class="annottext">pend_pat_splice :: forall b.
HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, Either b (Pat (GhcPass 'Renamed)))
</span><a href="#local-6989586621681127023"><span class="hs-identifier hs-var hs-var">pend_pat_splice</span></a></span></span><span> </span><span id="local-6989586621681127022"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127022"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>
</span><span id="line-683"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; HsSplice (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var">makePending</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedPatSplice"><span class="hs-identifier hs-var">UntypedPatSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127022"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>
</span><span id="line-684"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Pat (GhcPass 'Renamed) -&gt; Either b (Pat (GhcPass 'Renamed))
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">XSplicePat (GhcPass 'Renamed)
-&gt; HsSplice (GhcPass 'Renamed) -&gt; Pat (GhcPass 'Renamed)
forall p. XSplicePat p -&gt; HsSplice p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-var">SplicePat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSplicePat (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127022"><span class="hs-identifier hs-var">rn_splice</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-685"></span><span>
</span><span id="line-686"></span><span>    </span><span class="annot"><a href="#local-6989586621681127024"><span class="hs-identifier hs-type">run_pat_splice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-687"></span><span>                      </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Pat.html#Pat"><span class="hs-identifier hs-type">Pat</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-688"></span><span>    </span><span id="local-6989586621681127024"><span class="annot"><span class="annottext">run_pat_splice :: HsSplice (GhcPass 'Renamed)
-&gt; RnM (Either (Pat GhcPs) (Pat (GhcPass 'Renamed)), Uses)
</span><a href="#local-6989586621681127024"><span class="hs-identifier hs-var hs-var">run_pat_splice</span></a></span></span><span> </span><span id="local-6989586621681127020"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127020"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>
</span><span id="line-689"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnSplicePat: untyped pattern splice&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-690"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127019"><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcPs)
</span><a href="#local-6989586621681127019"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127018"><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127018"><span class="hs-identifier hs-var">mod_finalizers</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-691"></span><span>                </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn (GenLocated SrcSpan (Pat GhcPs)))
-&gt; (GenLocated SrcSpan (Pat GhcPs) -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (GenLocated SrcSpan (Pat GhcPs), [ForeignRef (Q ())])
forall res.
UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn res)
-&gt; (res -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (res, [ForeignRef (Q ())])
</span><a href="GHC.Rename.Splice.html#runRnSplice"><span class="hs-identifier hs-var">runRnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedPatSplice"><span class="hs-identifier hs-var">UntypedPatSplice</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; TcRn (GenLocated SrcSpan (Pat GhcPs))
LHsExpr GhcTc -&gt; TcM (LPat GhcPs)
</span><a href="GHC.Tc.Gen.Splice.html#runMetaP"><span class="hs-identifier hs-var">runMetaP</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcPs) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127020"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>
</span><span id="line-692"></span><span>             </span><span class="hs-comment">-- See Note [Delaying modFinalizers in untyped splices].</span><span>
</span><span id="line-693"></span><span>           </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(Either (Pat GhcPs) (Pat (GhcPass 'Renamed)), Uses)
-&gt; RnM (Either (Pat GhcPs) (Pat (GhcPass 'Renamed)), Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">Pat GhcPs -&gt; Either (Pat GhcPs) (Pat (GhcPass 'Renamed))
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">(Pat GhcPs -&gt; Either (Pat GhcPs) (Pat (GhcPass 'Renamed)))
-&gt; Pat GhcPs -&gt; Either (Pat GhcPs) (Pat (GhcPass 'Renamed))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">XParPat GhcPs -&gt; LPat GhcPs -&gt; Pat GhcPs
forall p. XParPat p -&gt; LPat p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#ParPat"><span class="hs-identifier hs-var">ParPat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XParPat GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="annot"><span class="annottext">(LPat GhcPs -&gt; Pat GhcPs) -&gt; LPat GhcPs -&gt; Pat GhcPs
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">XSplicePat GhcPs -&gt; HsSplice GhcPs -&gt; Pat GhcPs
forall p. XSplicePat p -&gt; HsSplice p -&gt; Pat p
</span><a href="GHC.Hs.Pat.html#SplicePat"><span class="hs-identifier hs-var">SplicePat</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSplicePat GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-694"></span><span>                              </span><span class="annot"><span class="annottext">(HsSplice GhcPs -&gt; Pat GhcPs)
-&gt; (Pat GhcPs -&gt; HsSplice GhcPs) -&gt; Pat GhcPs -&gt; Pat GhcPs
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliced GhcPs
-&gt; ThModFinalizers -&gt; HsSplicedThing GhcPs -&gt; HsSplice GhcPs
forall id.
XSpliced id -&gt; ThModFinalizers -&gt; HsSplicedThing id -&gt; HsSplice id
</span><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-var">HsSpliced</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliced GhcPs
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ForeignRef (Q ())] -&gt; ThModFinalizers
</span><a href="GHC.Hs.Expr.html#ThModFinalizers"><span class="hs-identifier hs-var">ThModFinalizers</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681127018"><span class="hs-identifier hs-var">mod_finalizers</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>                              </span><span class="annot"><span class="annottext">(HsSplicedThing GhcPs -&gt; HsSplice GhcPs)
-&gt; (Pat GhcPs -&gt; HsSplicedThing GhcPs)
-&gt; Pat GhcPs
-&gt; HsSplice GhcPs
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Pat GhcPs -&gt; HsSplicedThing GhcPs
forall id. Pat id -&gt; HsSplicedThing id
</span><a href="GHC.Hs.Expr.html#HsSplicedPat"><span class="hs-identifier hs-var">HsSplicedPat</span></a></span><span class="hs-special">)</span><span>  </span><span class="annot"><span class="annottext">(Pat GhcPs -&gt; Pat GhcPs)
-&gt; GenLocated SrcSpan (Pat GhcPs) -&gt; GenLocated SrcSpan (Pat GhcPs)
forall a b l. (a -&gt; b) -&gt; GenLocated l a -&gt; GenLocated l b
</span><a href="GHC.Types.SrcLoc.html#mapLoc"><span class="hs-operator hs-var">`mapLoc`</span></a></span><span>
</span><span id="line-696"></span><span>                              </span><span class="annot"><span class="annottext">GenLocated SrcSpan (Pat GhcPs)
</span><a href="#local-6989586621681127019"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-697"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Uses
</span><a href="GHC.Types.Name.Set.html#emptyFVs"><span class="hs-identifier hs-var">emptyFVs</span></a></span><span>
</span><span id="line-698"></span><span>                    </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-699"></span><span>              </span><span class="hs-comment">-- Wrap the result of the quasi-quoter in parens so that we don't</span><span>
</span><span id="line-700"></span><span>              </span><span class="hs-comment">-- lose the outermost location set by runQuasiQuote (#7918)</span><span>
</span><span id="line-701"></span><span>
</span><span id="line-702"></span><span class="hs-comment">----------------------</span><span>
</span><span id="line-703"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnSpliceDecl"><span class="hs-identifier hs-type">rnSpliceDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Decls.html#SpliceDecl"><span class="hs-identifier hs-type">SpliceDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#SpliceDecl"><span class="hs-identifier hs-type">SpliceDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-704"></span><span id="rnSpliceDecl"><span class="annot"><span class="annottext">rnSpliceDecl :: SpliceDecl GhcPs -&gt; RnM (SpliceDecl (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceDecl"><span class="hs-identifier hs-var hs-var">rnSpliceDecl</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Decls.html#SpliceDecl"><span class="hs-identifier hs-type">SpliceDecl</span></a></span><span> </span><span class="annot"><span class="annottext">XSpliceDecl GhcPs
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681127013"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127013"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681127012"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127012"><span class="hs-identifier hs-var">splice</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681127011"><span class="annot"><span class="annottext">SpliceExplicitFlag
</span><a href="#local-6989586621681127011"><span class="hs-identifier hs-var">flg</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-705"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(HsSplice (GhcPass 'Renamed)
 -&gt; RnM (SpliceDecl (GhcPass 'Renamed), Uses))
-&gt; (HsSplice (GhcPass 'Renamed)
    -&gt; (PendingRnSplice, SpliceDecl (GhcPass 'Renamed)))
-&gt; HsSplice GhcPs
-&gt; RnM (SpliceDecl (GhcPass 'Renamed), Uses)
forall a.
(HsSplice (GhcPass 'Renamed) -&gt; RnM (a, Uses))
-&gt; (HsSplice (GhcPass 'Renamed) -&gt; (PendingRnSplice, a))
-&gt; HsSplice GhcPs
-&gt; RnM (a, Uses)
</span><a href="GHC.Rename.Splice.html#rnSpliceGen"><span class="hs-identifier hs-var">rnSpliceGen</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; RnM (SpliceDecl (GhcPass 'Renamed), Uses)
forall {a} {a}. Outputable a =&gt; a -&gt; a
</span><a href="#local-6989586621681127010"><span class="hs-identifier hs-var">run_decl_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, SpliceDecl (GhcPass 'Renamed))
</span><a href="#local-6989586621681127009"><span class="hs-identifier hs-var">pend_decl_splice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127012"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-706"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-707"></span><span>    </span><span id="local-6989586621681127009"><span class="annot"><span class="annottext">pend_decl_splice :: HsSplice (GhcPass 'Renamed)
-&gt; (PendingRnSplice, SpliceDecl (GhcPass 'Renamed))
</span><a href="#local-6989586621681127009"><span class="hs-identifier hs-var hs-var">pend_decl_splice</span></a></span></span><span> </span><span id="local-6989586621681127008"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127008"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>
</span><span id="line-708"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; HsSplice (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Rename.Splice.html#makePending"><span class="hs-identifier hs-var">makePending</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedDeclSplice"><span class="hs-identifier hs-var">UntypedDeclSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127008"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>
</span><span id="line-709"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">XSpliceDecl (GhcPass 'Renamed)
-&gt; Located (HsSplice (GhcPass 'Renamed))
-&gt; SpliceExplicitFlag
-&gt; SpliceDecl (GhcPass 'Renamed)
forall p.
XSpliceDecl p
-&gt; Located (HsSplice p) -&gt; SpliceExplicitFlag -&gt; SpliceDecl p
</span><a href="GHC.Hs.Decls.html#SpliceDecl"><span class="hs-identifier hs-var">SpliceDecl</span></a></span><span> </span><span class="annot"><span class="annottext">NoExtField
XSpliceDecl (GhcPass 'Renamed)
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; Located (HsSplice (GhcPass 'Renamed))
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681127013"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127008"><span class="hs-identifier hs-var">rn_splice</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">SpliceExplicitFlag
</span><a href="#local-6989586621681127011"><span class="hs-identifier hs-var">flg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span>    </span><span id="local-6989586621681127010"><span class="annot"><span class="annottext">run_decl_splice :: a -&gt; a
</span><a href="#local-6989586621681127010"><span class="hs-identifier hs-var hs-var">run_decl_splice</span></a></span></span><span> </span><span id="local-6989586621681127003"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127003"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; a
forall a. HasCallStack =&gt; String -&gt; MsgDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnSpliceDecl&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681127003"><span class="hs-identifier hs-var">rn_splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-712"></span><span>
</span><span id="line-713"></span><span class="annot"><a href="GHC.Rename.Splice.html#rnTopSpliceDecls"><span class="hs-identifier hs-type">rnTopSpliceDecls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Decls.html#LHsDecl"><span class="hs-identifier hs-type">LHsDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Name.Set.html#FreeVars"><span class="hs-identifier hs-type">FreeVars</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-714"></span><span class="hs-comment">-- Declaration splice at the very top level of the module</span><span>
</span><span id="line-715"></span><span id="rnTopSpliceDecls"><span class="annot"><span class="annottext">rnTopSpliceDecls :: HsSplice GhcPs -&gt; RnM ([LHsDecl GhcPs], Uses)
</span><a href="GHC.Rename.Splice.html#rnTopSpliceDecls"><span class="hs-identifier hs-var hs-var">rnTopSpliceDecls</span></a></span></span><span> </span><span id="local-6989586621681127002"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127002"><span class="hs-identifier hs-var">splice</span></a></span></span><span>
</span><span id="line-716"></span><span>   </span><span class="hs-glyph">=</span><span>  </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#checkTopSpliceAllowed"><span class="hs-identifier hs-var">checkTopSpliceAllowed</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127002"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-717"></span><span>         </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681127001"><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127001"><span class="hs-identifier hs-var">rn_splice</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681127000"><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127000"><span class="hs-identifier hs-var">fvs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM (HsSplice (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses))
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-718"></span><span>                               </span><span class="annot"><span class="annottext">ThStage
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a. ThStage -&gt; TcM a -&gt; TcM a
</span><a href="GHC.Tc.Utils.Monad.html#setStage"><span class="hs-identifier hs-var">setStage</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SpliceType -&gt; ThStage
</span><a href="GHC.Tc.Types.html#Splice"><span class="hs-identifier hs-var">Splice</span></a></span><span> </span><span class="annot"><span class="annottext">SpliceType
</span><a href="GHC.Tc.Types.html#Untyped"><span class="hs-identifier hs-var">Untyped</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcM (HsSplice (GhcPass 'Renamed), Uses)
 -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses))
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
-&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-719"></span><span>                               </span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; TcM (HsSplice (GhcPass 'Renamed), Uses)
</span><a href="GHC.Rename.Splice.html#rnSplice"><span class="hs-identifier hs-var">rnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681127002"><span class="hs-identifier hs-var">splice</span></a></span><span>
</span><span id="line-720"></span><span>           </span><span class="hs-comment">-- As always, be sure to checkNoErrs above lest we end up with</span><span>
</span><span id="line-721"></span><span>           </span><span class="hs-comment">-- holes making it to typechecking, hence #12584.</span><span>
</span><span id="line-722"></span><span>           </span><span class="hs-comment">--</span><span>
</span><span id="line-723"></span><span>           </span><span class="hs-comment">-- Note that we cannot call checkNoErrs for the whole duration</span><span>
</span><span id="line-724"></span><span>           </span><span class="hs-comment">-- of rnTopSpliceDecls. The reason is that checkNoErrs changes</span><span>
</span><span id="line-725"></span><span>           </span><span class="hs-comment">-- the local environment to temporarily contain a new</span><span>
</span><span id="line-726"></span><span>           </span><span class="hs-comment">-- reference to store errors, and add_mod_finalizers would</span><span>
</span><span id="line-727"></span><span>           </span><span class="hs-comment">-- cause this reference to be stored after checkNoErrs finishes.</span><span>
</span><span id="line-728"></span><span>           </span><span class="hs-comment">-- This is checked by test TH_finalizer.</span><span>
</span><span id="line-729"></span><span>         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;rnTopSpliceDecls: untyped declaration splice&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#empty"><span class="hs-identifier hs-var">empty</span></a></span><span>
</span><span id="line-730"></span><span>         </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681126999"><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681126999"><span class="hs-identifier hs-var">decls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681126998"><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681126998"><span class="hs-identifier hs-var">mod_finalizers</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcM ([LHsDecl GhcPs], [ForeignRef (Q ())])
-&gt; TcM ([LHsDecl GhcPs], [ForeignRef (Q ())])
forall r. TcM r -&gt; TcM r
</span><a href="GHC.Tc.Utils.Monad.html#checkNoErrs"><span class="hs-identifier hs-var">checkNoErrs</span></a></span><span> </span><span class="annot"><span class="annottext">(TcM ([LHsDecl GhcPs], [ForeignRef (Q ())])
 -&gt; TcM ([LHsDecl GhcPs], [ForeignRef (Q ())]))
-&gt; TcM ([LHsDecl GhcPs], [ForeignRef (Q ())])
-&gt; TcM ([LHsDecl GhcPs], [ForeignRef (Q ())])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-731"></span><span>               </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn [LHsDecl GhcPs])
-&gt; ([LHsDecl GhcPs] -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcM ([LHsDecl GhcPs], [ForeignRef (Q ())])
forall res.
UntypedSpliceFlavour
-&gt; (LHsExpr GhcTc -&gt; TcRn res)
-&gt; (res -&gt; MsgDoc)
-&gt; HsSplice (GhcPass 'Renamed)
-&gt; TcRn (res, [ForeignRef (Q ())])
</span><a href="GHC.Rename.Splice.html#runRnSplice"><span class="hs-identifier hs-var">runRnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedDeclSplice"><span class="hs-identifier hs-var">UntypedDeclSplice</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; TcRn [LHsDecl GhcPs]
</span><a href="GHC.Tc.Gen.Splice.html#runMetaD"><span class="hs-identifier hs-var">runMetaD</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs] -&gt; MsgDoc
</span><a href="#local-6989586621681126997"><span class="hs-identifier hs-var">ppr_decls</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice (GhcPass 'Renamed)
</span><a href="#local-6989586621681127001"><span class="hs-identifier hs-var">rn_splice</span></a></span><span>
</span><span id="line-732"></span><span>         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681126996"><span class="hs-identifier hs-var">add_mod_finalizers_now</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681126998"><span class="hs-identifier hs-var">mod_finalizers</span></a></span><span>
</span><span id="line-733"></span><span>         </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([LHsDecl GhcPs], Uses) -&gt; RnM ([LHsDecl GhcPs], Uses)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681126999"><span class="hs-identifier hs-var">decls</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">Uses
</span><a href="#local-6989586621681127000"><span class="hs-identifier hs-var">fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-734"></span><span>   </span><span class="hs-keyword">where</span><span>
</span><span id="line-735"></span><span>     </span><span class="annot"><a href="#local-6989586621681126997"><span class="hs-identifier hs-type">ppr_decls</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Decls.html#LHsDecl"><span class="hs-identifier hs-type">LHsDecl</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-736"></span><span>     </span><span id="local-6989586621681126997"><span class="annot"><span class="annottext">ppr_decls :: [LHsDecl GhcPs] -&gt; MsgDoc
</span><a href="#local-6989586621681126997"><span class="hs-identifier hs-var hs-var">ppr_decls</span></a></span></span><span> </span><span id="local-6989586621681126995"><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681126995"><span class="hs-identifier hs-var">ds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(LHsDecl GhcPs -&gt; MsgDoc) -&gt; [LHsDecl GhcPs] -&gt; [MsgDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">LHsDecl GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[LHsDecl GhcPs]
</span><a href="#local-6989586621681126995"><span class="hs-identifier hs-var">ds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-737"></span><span>
</span><span id="line-738"></span><span>     </span><span class="hs-comment">-- Adds finalizers to the global environment instead of delaying them</span><span>
</span><span id="line-739"></span><span>     </span><span class="hs-comment">-- to the type checker.</span><span>
</span><span id="line-740"></span><span>     </span><span class="hs-comment">--</span><span>
</span><span id="line-741"></span><span>     </span><span class="hs-comment">-- Declaration splices do not have an interesting local environment so</span><span>
</span><span id="line-742"></span><span>     </span><span class="hs-comment">-- there is no point in delaying them.</span><span>
</span><span id="line-743"></span><span>     </span><span class="hs-comment">--</span><span>
</span><span id="line-744"></span><span>     </span><span class="hs-comment">-- See Note [Delaying modFinalizers in untyped splices].</span><span>
</span><span id="line-745"></span><span>     </span><span class="annot"><a href="#local-6989586621681126996"><span class="hs-identifier hs-type">add_mod_finalizers_now</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="../../ghci/src/GHCi.RemoteTypes.html#ForeignRef"><span class="hs-identifier hs-type">ForeignRef</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../template-haskell/src/Language.Haskell.TH.Syntax.html#Q"><span class="hs-identifier hs-type">TH.Q</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRn"><span class="hs-identifier hs-type">TcRn</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-746"></span><span>     </span><span id="local-6989586621681126996"><span class="annot"><span class="annottext">add_mod_finalizers_now :: [ForeignRef (Q ())] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="#local-6989586621681126996"><span class="hs-identifier hs-var hs-var">add_mod_finalizers_now</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-747"></span><span>     </span><span class="annot"><a href="#local-6989586621681126996"><span class="hs-identifier hs-var">add_mod_finalizers_now</span></a></span><span> </span><span id="local-6989586621681126994"><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681126994"><span class="hs-identifier hs-var">mod_finalizers</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-748"></span><span>       </span><span id="local-6989586621681126993"><span class="annot"><span class="annottext">TcRef [(TcLclEnv, ThModFinalizers)]
</span><a href="#local-6989586621681126993"><span class="hs-identifier hs-var">th_modfinalizers_var</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(TcGblEnv -&gt; TcRef [(TcLclEnv, ThModFinalizers)])
-&gt; TcRnIf TcGblEnv TcLclEnv TcGblEnv
-&gt; IOEnv
     (Env TcGblEnv TcLclEnv) (TcRef [(TcLclEnv, ThModFinalizers)])
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="../../base/src/GHC.Base.html#fmap"><span class="hs-identifier hs-var">fmap</span></a></span><span> </span><span class="annot"><span class="annottext">TcGblEnv -&gt; TcRef [(TcLclEnv, ThModFinalizers)]
</span><a href="GHC.Tc.Types.html#tcg_th_modfinalizers"><span class="hs-identifier hs-var hs-var">tcg_th_modfinalizers</span></a></span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcGblEnv
forall gbl lcl. TcRnIf gbl lcl gbl
</span><a href="GHC.Tc.Utils.Monad.html#getGblEnv"><span class="hs-identifier hs-var">getGblEnv</span></a></span><span>
</span><span id="line-749"></span><span>       </span><span id="local-6989586621681126991"><span class="annot"><span class="annottext">TcLclEnv
</span><a href="#local-6989586621681126991"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf TcGblEnv TcLclEnv TcLclEnv
forall gbl lcl. TcRnIf gbl lcl lcl
</span><a href="GHC.Tc.Utils.Monad.html#getLclEnv"><span class="hs-identifier hs-var">getLclEnv</span></a></span><span>
</span><span id="line-750"></span><span>       </span><span class="annot"><span class="annottext">TcRef [(TcLclEnv, ThModFinalizers)]
-&gt; ([(TcLclEnv, ThModFinalizers)] -&gt; [(TcLclEnv, ThModFinalizers)])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a gbl lcl. TcRef a -&gt; (a -&gt; a) -&gt; TcRnIf gbl lcl ()
</span><a href="GHC.Tc.Utils.Monad.html#updTcRef"><span class="hs-identifier hs-var">updTcRef</span></a></span><span> </span><span class="annot"><span class="annottext">TcRef [(TcLclEnv, ThModFinalizers)]
</span><a href="#local-6989586621681126993"><span class="hs-identifier hs-var">th_modfinalizers_var</span></a></span><span> </span><span class="annot"><span class="annottext">(([(TcLclEnv, ThModFinalizers)] -&gt; [(TcLclEnv, ThModFinalizers)])
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; ([(TcLclEnv, ThModFinalizers)] -&gt; [(TcLclEnv, ThModFinalizers)])
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681126988"><span class="annot"><span class="annottext">[(TcLclEnv, ThModFinalizers)]
</span><a href="#local-6989586621681126988"><span class="hs-identifier hs-var">fins</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-751"></span><span>         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcLclEnv
</span><a href="#local-6989586621681126991"><span class="hs-identifier hs-var">env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())] -&gt; ThModFinalizers
</span><a href="GHC.Hs.Expr.html#ThModFinalizers"><span class="hs-identifier hs-var">ThModFinalizers</span></a></span><span> </span><span class="annot"><span class="annottext">[ForeignRef (Q ())]
</span><a href="#local-6989586621681126994"><span class="hs-identifier hs-var">mod_finalizers</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(TcLclEnv, ThModFinalizers)
-&gt; [(TcLclEnv, ThModFinalizers)] -&gt; [(TcLclEnv, ThModFinalizers)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[(TcLclEnv, ThModFinalizers)]
</span><a href="#local-6989586621681126988"><span class="hs-identifier hs-var">fins</span></a></span><span>
</span><span id="line-752"></span><span>
</span><span id="line-753"></span><span>
</span><span id="line-754"></span><span class="hs-comment">{-
Note [rnSplicePat]
~~~~~~~~~~~~~~~~~~
Renaming a pattern splice is a bit tricky, because we need the variables
bound in the pattern to be in scope in the RHS of the pattern. This scope
management is effectively done by using continuation-passing style in
GHC.Rename.Pat, through the CpsRn monad. We don't wish to be in that monad here
(it would create import cycles and generally conflict with renaming other
splices), so we really want to return a (Pat RdrName) -- the result of
running the splice -- which can then be further renamed in GHC.Rename.Pat, in
the CpsRn monad.

The problem is that if we're renaming a splice within a bracket, we
*don't* want to run the splice now. We really do just want to rename
it to an HsSplice Name. Of course, then we can't know what variables
are bound within the splice. So we accept any unbound variables and
rename them again when the bracket is spliced in.  If a variable is brought
into scope by a pattern splice all is fine.  If it is not then an error is
reported.

In any case, when we're done in rnSplicePat, we'll either have a
Pat RdrName (the result of running a top-level splice) or a Pat Name
(the renamed nested splice). Thus, the awkward return type of
rnSplicePat.
-}</span><span>
</span><span id="line-779"></span><span>
</span><span id="line-780"></span><span class="annot"><a href="GHC.Rename.Splice.html#spliceCtxt"><span class="hs-identifier hs-type">spliceCtxt</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSplice"><span class="hs-identifier hs-type">HsSplice</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcPs"><span class="hs-identifier hs-type">GhcPs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-781"></span><span id="spliceCtxt"><span class="annot"><span class="annottext">spliceCtxt :: HsSplice GhcPs -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#spliceCtxt"><span class="hs-identifier hs-var hs-var">spliceCtxt</span></a></span></span><span> </span><span id="local-6989586621681126987"><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681126987"><span class="hs-identifier hs-var">splice</span></a></span></span><span>
</span><span id="line-782"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; ThLevel -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;In the&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681126986"><span class="hs-identifier hs-var">what</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsSplice GhcPs -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681126987"><span class="hs-identifier hs-var">splice</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-783"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-784"></span><span>    </span><span id="local-6989586621681126986"><span class="annot"><span class="annottext">what :: MsgDoc
</span><a href="#local-6989586621681126986"><span class="hs-identifier hs-var hs-var">what</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">HsSplice GhcPs
</span><a href="#local-6989586621681126987"><span class="hs-identifier hs-var">splice</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-785"></span><span>             </span><span class="annot"><a href="GHC.Hs.Expr.html#HsUntypedSplice"><span class="hs-identifier hs-type">HsUntypedSplice</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;untyped splice:&quot;</span></span><span>
</span><span id="line-786"></span><span>             </span><span class="annot"><a href="GHC.Hs.Expr.html#HsTypedSplice"><span class="hs-identifier hs-type">HsTypedSplice</span></a></span><span>   </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;typed splice:&quot;</span></span><span>
</span><span id="line-787"></span><span>             </span><span class="annot"><a href="GHC.Hs.Expr.html#HsQuasiQuote"><span class="hs-identifier hs-type">HsQuasiQuote</span></a></span><span>    </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;quasi-quotation:&quot;</span></span><span>
</span><span id="line-788"></span><span>             </span><span class="annot"><a href="GHC.Hs.Expr.html#HsSpliced"><span class="hs-identifier hs-type">HsSpliced</span></a></span><span>       </span><span class="hs-special">{</span><span class="hs-special">}</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;spliced expression:&quot;</span></span><span>
</span><span id="line-789"></span><span>
</span><span id="line-790"></span><span class="hs-comment">-- | The splice data to be logged</span><span>
</span><span id="line-791"></span><span class="hs-keyword">data</span><span> </span><span id="SpliceInfo"><span class="annot"><a href="GHC.Rename.Splice.html#SpliceInfo"><span class="hs-identifier hs-var">SpliceInfo</span></a></span></span><span>
</span><span id="line-792"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="SpliceInfo"><span class="annot"><a href="GHC.Rename.Splice.html#SpliceInfo"><span class="hs-identifier hs-var">SpliceInfo</span></a></span></span><span>
</span><span id="line-793"></span><span>    </span><span class="hs-special">{</span><span> </span><span id="spliceDescription"><span class="annot"><span class="annottext">SpliceInfo -&gt; String
</span><a href="GHC.Rename.Splice.html#spliceDescription"><span class="hs-identifier hs-var hs-var">spliceDescription</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-794"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="spliceSource"><span class="annot"><span class="annottext">SpliceInfo -&gt; Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="GHC.Rename.Splice.html#spliceSource"><span class="hs-identifier hs-var hs-var">spliceSource</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Expr.html#LHsExpr"><span class="hs-identifier hs-type">LHsExpr</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcRn"><span class="hs-identifier hs-type">GhcRn</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Nothing &lt;=&gt; top-level decls</span><span>
</span><span id="line-795"></span><span>                                                  </span><span class="hs-comment">--        added by addTopDecls</span><span>
</span><span id="line-796"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="spliceIsDecl"><span class="annot"><span class="annottext">SpliceInfo -&gt; Bool
</span><a href="GHC.Rename.Splice.html#spliceIsDecl"><span class="hs-identifier hs-var hs-var">spliceIsDecl</span></a></span></span><span>       </span><span class="hs-glyph">::</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>    </span><span class="hs-comment">-- True &lt;=&gt; put the generate code in a file</span><span>
</span><span id="line-797"></span><span>                                    </span><span class="hs-comment">--          when -dth-dec-file is on</span><span>
</span><span id="line-798"></span><span>    </span><span class="hs-special">,</span><span> </span><span id="spliceGenerated"><span class="annot"><span class="annottext">SpliceInfo -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#spliceGenerated"><span class="hs-identifier hs-var hs-var">spliceGenerated</span></a></span></span><span>    </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-799"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-800"></span><span>        </span><span class="hs-comment">-- Note that 'spliceSource' is *renamed* but not *typechecked*</span><span>
</span><span id="line-801"></span><span>        </span><span class="hs-comment">-- Reason (a) less typechecking crap</span><span>
</span><span id="line-802"></span><span>        </span><span class="hs-comment">--        (b) data constructors after type checking have been</span><span>
</span><span id="line-803"></span><span>        </span><span class="hs-comment">--            changed to their *wrappers*, and that makes them</span><span>
</span><span id="line-804"></span><span>        </span><span class="hs-comment">--            print always fully qualified</span><span>
</span><span id="line-805"></span><span>
</span><span id="line-806"></span><span class="hs-comment">-- | outputs splice information for 2 flags which have different output formats:</span><span>
</span><span id="line-807"></span><span class="hs-comment">-- `-ddump-splices` and `-dth-dec-file`</span><span>
</span><span id="line-808"></span><span class="annot"><a href="GHC.Rename.Splice.html#traceSplice"><span class="hs-identifier hs-type">traceSplice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Rename.Splice.html#SpliceInfo"><span class="hs-identifier hs-type">SpliceInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-809"></span><span id="traceSplice"><span class="annot"><span class="annottext">traceSplice :: SpliceInfo -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#traceSplice"><span class="hs-identifier hs-var hs-var">traceSplice</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Rename.Splice.html#SpliceInfo"><span class="hs-identifier hs-type">SpliceInfo</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">spliceDescription :: SpliceInfo -&gt; String
</span><a href="GHC.Rename.Splice.html#spliceDescription"><span class="hs-identifier hs-var">spliceDescription</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681126985"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681126985"><span class="hs-identifier hs-var">sd</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spliceSource :: SpliceInfo -&gt; Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="GHC.Rename.Splice.html#spliceSource"><span class="hs-identifier hs-var">spliceSource</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681126984"><span class="annot"><span class="annottext">Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="#local-6989586621681126984"><span class="hs-identifier hs-var">mb_src</span></a></span></span><span>
</span><span id="line-810"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spliceGenerated :: SpliceInfo -&gt; MsgDoc
</span><a href="GHC.Rename.Splice.html#spliceGenerated"><span class="hs-identifier hs-var">spliceGenerated</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681126983"><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681126983"><span class="hs-identifier hs-var">gen</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">spliceIsDecl :: SpliceInfo -&gt; Bool
</span><a href="GHC.Rename.Splice.html#spliceIsDecl"><span class="hs-identifier hs-var">spliceIsDecl</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681126982"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681126982"><span class="hs-identifier hs-var">is_decl</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-811"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681126981"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126981"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="#local-6989586621681126984"><span class="hs-identifier hs-var">mb_src</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-812"></span><span>                   </span><span class="annot"><span class="annottext">Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">TcRn SrcSpan
</span><a href="GHC.Tc.Utils.Monad.html#getSrcSpanM"><span class="hs-identifier hs-var">getSrcSpanM</span></a></span><span>
</span><span id="line-813"></span><span>                   </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681126980"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126980"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsExpr (GhcPass 'Renamed)
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; TcRn SrcSpan
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126980"><span class="hs-identifier hs-var">loc</span></a></span><span>
</span><span id="line-814"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DumpFlag -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceOptTcRn"><span class="hs-identifier hs-var">traceOptTcRn</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_splices"><span class="hs-identifier hs-var">Opt_D_dump_splices</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
</span><a href="#local-6989586621681126977"><span class="hs-identifier hs-var">spliceDebugDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126981"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-815"></span><span>
</span><span id="line-816"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681126982"><span class="hs-identifier hs-var">is_decl</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env TcGblEnv TcLclEnv) ()
 -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>  </span><span class="hs-comment">-- Raw material for -dth-dec-file</span><span>
</span><span id="line-817"></span><span>         </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681126976"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681126976"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env TcGblEnv TcLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-818"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; IOEnv (Env TcGblEnv TcLclEnv) ())
-&gt; IO () -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
-&gt; DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; MsgDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn_printer"><span class="hs-identifier hs-var">dumpIfSet_dyn_printer</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="GHC.Utils.Outputable.html#alwaysQualify"><span class="hs-identifier hs-var">alwaysQualify</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681126976"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_th_dec_file"><span class="hs-identifier hs-var">Opt_D_th_dec_file</span></a></span><span>
</span><span id="line-819"></span><span>                                             </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&quot;</span></span><span> </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatHaskell"><span class="hs-identifier hs-var">FormatHaskell</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
</span><a href="#local-6989586621681126970"><span class="hs-identifier hs-var">spliceCodeDoc</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126981"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-820"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-821"></span><span>    </span><span class="hs-comment">-- `-ddump-splices`</span><span>
</span><span id="line-822"></span><span>    </span><span class="annot"><a href="#local-6989586621681126977"><span class="hs-identifier hs-type">spliceDebugDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-823"></span><span>    </span><span id="local-6989586621681126977"><span class="annot"><span class="annottext">spliceDebugDoc :: SrcSpan -&gt; MsgDoc
</span><a href="#local-6989586621681126977"><span class="hs-identifier hs-var hs-var">spliceDebugDoc</span></a></span></span><span> </span><span id="local-6989586621681126969"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126969"><span class="hs-identifier hs-var">loc</span></a></span></span><span>
</span><span id="line-824"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681126968"><span class="annot"><span class="annottext">code :: [MsgDoc]
</span><a href="#local-6989586621681126968"><span class="hs-identifier hs-var hs-var">code</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="#local-6989586621681126984"><span class="hs-identifier hs-var">mb_src</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-825"></span><span>                     </span><span class="annot"><span class="annottext">Maybe (LHsExpr (GhcPass 'Renamed))
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681126967"><span class="hs-identifier hs-var">ending</span></a></span><span>
</span><span id="line-826"></span><span>                     </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681126966"><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681126966"><span class="hs-identifier hs-var">e</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed) -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall (p :: Pass). LHsExpr (GhcPass p) -&gt; LHsExpr (GhcPass p)
</span><a href="GHC.Hs.Expr.html#stripParensLHsExpr"><span class="hs-identifier hs-var">stripParensLHsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681126966"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; [MsgDoc] -&gt; [MsgDoc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681126967"><span class="hs-identifier hs-var">ending</span></a></span><span>
</span><span id="line-827"></span><span>            </span><span id="local-6989586621681126967"><span class="annot"><span class="annottext">ending :: [MsgDoc]
</span><a href="#local-6989586621681126967"><span class="hs-identifier hs-var hs-var">ending</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;======&gt;&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#nest"><span class="hs-identifier hs-var">nest</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681126983"><span class="hs-identifier hs-var">gen</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-828"></span><span>        </span><span class="hs-keyword">in</span><span>  </span><span class="annot"><span class="annottext">MsgDoc -&gt; ThLevel -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126969"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Splicing&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681126985"><span class="hs-identifier hs-var">sd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-829"></span><span>               </span><span class="annot"><span class="annottext">ThLevel
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="annot"><span class="annottext">[MsgDoc]
</span><a href="#local-6989586621681126968"><span class="hs-identifier hs-var">code</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-830"></span><span>
</span><span id="line-831"></span><span>    </span><span class="hs-comment">-- `-dth-dec-file`</span><span>
</span><span id="line-832"></span><span>    </span><span class="annot"><a href="#local-6989586621681126970"><span class="hs-identifier hs-type">spliceCodeDoc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#SrcSpan"><span class="hs-identifier hs-type">SrcSpan</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-833"></span><span>    </span><span id="local-6989586621681126970"><span class="annot"><span class="annottext">spliceCodeDoc :: SrcSpan -&gt; MsgDoc
</span><a href="#local-6989586621681126970"><span class="hs-identifier hs-var hs-var">spliceCodeDoc</span></a></span></span><span> </span><span id="local-6989586621681126961"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126961"><span class="hs-identifier hs-var">loc</span></a></span></span><span>
</span><span id="line-834"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[MsgDoc] -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;--&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681126961"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="GHC.Utils.Outputable.html#colon"><span class="hs-identifier hs-var">colon</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Splicing&quot;</span></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681126985"><span class="hs-identifier hs-var">sd</span></a></span><span>
</span><span id="line-835"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MsgDoc
</span><a href="#local-6989586621681126983"><span class="hs-identifier hs-var">gen</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-836"></span><span>
</span><span id="line-837"></span><span class="annot"><a href="GHC.Rename.Splice.html#illegalTypedSplice"><span class="hs-identifier hs-type">illegalTypedSplice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-838"></span><span id="illegalTypedSplice"><span class="annot"><span class="annottext">illegalTypedSplice :: MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalTypedSplice"><span class="hs-identifier hs-var hs-var">illegalTypedSplice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Typed splices may not appear in untyped brackets&quot;</span></span><span>
</span><span id="line-839"></span><span>
</span><span id="line-840"></span><span class="annot"><a href="GHC.Rename.Splice.html#illegalUntypedSplice"><span class="hs-identifier hs-type">illegalUntypedSplice</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-841"></span><span id="illegalUntypedSplice"><span class="annot"><span class="annottext">illegalUntypedSplice :: MsgDoc
</span><a href="GHC.Rename.Splice.html#illegalUntypedSplice"><span class="hs-identifier hs-var hs-var">illegalUntypedSplice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Untyped splices may not appear in typed brackets&quot;</span></span><span>
</span><span id="line-842"></span><span>
</span><span id="line-843"></span><span class="annot"><a href="GHC.Rename.Splice.html#checkThLocalName"><span class="hs-identifier hs-type">checkThLocalName</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#RnM"><span class="hs-identifier hs-type">RnM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-844"></span><span id="checkThLocalName"><span class="annot"><span class="annottext">checkThLocalName :: Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#checkThLocalName"><span class="hs-identifier hs-var hs-var">checkThLocalName</span></a></span></span><span> </span><span id="local-6989586621681126960"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126960"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-845"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Builtin.Names.html#isUnboundName"><span class="hs-identifier hs-var">isUnboundName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126960"><span class="hs-identifier hs-var">name</span></a></span><span>   </span><span class="hs-comment">-- Do not report two errors for</span><span>
</span><span id="line-846"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>            </span><span class="hs-comment">--   $(not_in_scope args)</span><span>
</span><span id="line-847"></span><span>
</span><span id="line-848"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-849"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;checkThLocalName&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126960"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-850"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681126959"><span class="annot"><span class="annottext">Maybe (TopLevelFlag, ThLevel, ThStage)
</span><a href="#local-6989586621681126959"><span class="hs-identifier hs-var">mb_local_use</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; TcRn (Maybe (TopLevelFlag, ThLevel, ThStage))
</span><a href="GHC.Tc.Utils.Monad.html#getStageAndBindLevel"><span class="hs-identifier hs-var">getStageAndBindLevel</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126960"><span class="hs-identifier hs-var">name</span></a></span><span>
</span><span id="line-851"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Maybe (TopLevelFlag, ThLevel, ThStage)
</span><a href="#local-6989586621681126959"><span class="hs-identifier hs-var">mb_local_use</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-852"></span><span>             </span><span class="annot"><span class="annottext">Maybe (TopLevelFlag, ThLevel, ThStage)
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-special">;</span><span>  </span><span class="hs-comment">-- Not a locally-bound thing</span><span>
</span><span id="line-853"></span><span>             </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681126957"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681126957"><span class="hs-identifier hs-var">top_lvl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681126956"><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126956"><span class="hs-identifier hs-var">bind_lvl</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681126955"><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681126955"><span class="hs-identifier hs-var">use_stage</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-854"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681126954"><span class="annot"><span class="annottext">use_lvl :: ThLevel
</span><a href="#local-6989586621681126954"><span class="hs-identifier hs-var hs-var">use_lvl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ThStage -&gt; ThLevel
</span><a href="GHC.Tc.Types.html#thLevel"><span class="hs-identifier hs-var">thLevel</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681126955"><span class="hs-identifier hs-var">use_stage</span></a></span><span>
</span><span id="line-855"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; ThLevel -&gt; ThLevel -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Env.html#checkWellStaged"><span class="hs-identifier hs-var">checkWellStaged</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126960"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126956"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126954"><span class="hs-identifier hs-var">use_lvl</span></a></span><span>
</span><span id="line-856"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;checkThLocalName&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126960"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126956"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span>
</span><span id="line-857"></span><span>                                               </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681126955"><span class="hs-identifier hs-var">use_stage</span></a></span><span>
</span><span id="line-858"></span><span>                                               </span><span class="annot"><span class="annottext">MsgDoc -&gt; MsgDoc -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126954"><span class="hs-identifier hs-var">use_lvl</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-859"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
-&gt; ThLevel
-&gt; ThStage
-&gt; ThLevel
-&gt; Name
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#checkCrossStageLifting"><span class="hs-identifier hs-var">checkCrossStageLifting</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681126957"><span class="hs-identifier hs-var">top_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126956"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681126955"><span class="hs-identifier hs-var">use_stage</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126954"><span class="hs-identifier hs-var">use_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126960"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-860"></span><span>
</span><span id="line-861"></span><span class="hs-comment">--------------------------------------</span><span>
</span><span id="line-862"></span><span class="annot"><a href="GHC.Rename.Splice.html#checkCrossStageLifting"><span class="hs-identifier hs-type">checkCrossStageLifting</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier hs-type">TopLevelFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ThLevel"><span class="hs-identifier hs-type">ThLevel</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ThStage"><span class="hs-identifier hs-type">ThStage</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#ThLevel"><span class="hs-identifier hs-type">ThLevel</span></a></span><span>
</span><span id="line-863"></span><span>                       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-864"></span><span class="hs-comment">-- We are inside brackets, and (use_lvl &gt; bind_lvl)</span><span>
</span><span id="line-865"></span><span class="hs-comment">-- Now we must check whether there's a cross-stage lift to do</span><span>
</span><span id="line-866"></span><span class="hs-comment">-- Examples   \x -&gt; [| x |]</span><span>
</span><span id="line-867"></span><span class="hs-comment">--            [| map |]</span><span>
</span><span id="line-868"></span><span class="hs-comment">--</span><span>
</span><span id="line-869"></span><span class="hs-comment">-- This code is similar to checkCrossStageLifting in GHC.Tc.Gen.Expr, but</span><span>
</span><span id="line-870"></span><span class="hs-comment">-- this is only run on *untyped* brackets.</span><span>
</span><span id="line-871"></span><span>
</span><span id="line-872"></span><span id="checkCrossStageLifting"><span class="annot"><span class="annottext">checkCrossStageLifting :: TopLevelFlag
-&gt; ThLevel
-&gt; ThStage
-&gt; ThLevel
-&gt; Name
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#checkCrossStageLifting"><span class="hs-identifier hs-var hs-var">checkCrossStageLifting</span></a></span></span><span> </span><span id="local-6989586621681126951"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681126951"><span class="hs-identifier hs-var">top_lvl</span></a></span></span><span> </span><span id="local-6989586621681126950"><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126950"><span class="hs-identifier hs-var">bind_lvl</span></a></span></span><span> </span><span id="local-6989586621681126949"><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681126949"><span class="hs-identifier hs-var">use_stage</span></a></span></span><span> </span><span id="local-6989586621681126948"><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126948"><span class="hs-identifier hs-var">use_lvl</span></a></span></span><span> </span><span id="local-6989586621681126947"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126947"><span class="hs-identifier hs-var">name</span></a></span></span><span>
</span><span id="line-873"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#Brack"><span class="hs-identifier hs-type">Brack</span></a></span><span> </span><span class="annot"><span class="annottext">ThStage
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.html#RnPendingUntyped"><span class="hs-identifier hs-type">RnPendingUntyped</span></a></span><span> </span><span id="local-6989586621681126946"><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681126946"><span class="hs-identifier hs-var">ps_var</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ThStage
</span><a href="#local-6989586621681126949"><span class="hs-identifier hs-var">use_stage</span></a></span><span>   </span><span class="hs-comment">-- Only for untyped brackets</span><span>
</span><span id="line-874"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126948"><span class="hs-identifier hs-var">use_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">ThLevel -&gt; ThLevel -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">ThLevel
</span><a href="#local-6989586621681126950"><span class="hs-identifier hs-var">bind_lvl</span></a></span><span>                               </span><span class="hs-comment">-- Cross-stage condition</span><span>
</span><span id="line-875"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
-&gt; Name
-&gt; IORef [PendingRnSplice]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#check_cross_stage_lifting"><span class="hs-identifier hs-var">check_cross_stage_lifting</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681126951"><span class="hs-identifier hs-var">top_lvl</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126947"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681126946"><span class="hs-identifier hs-var">ps_var</span></a></span><span>
</span><span id="line-876"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-877"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-878"></span><span>
</span><span id="line-879"></span><span class="annot"><a href="GHC.Rename.Splice.html#check_cross_stage_lifting"><span class="hs-identifier hs-type">check_cross_stage_lifting</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#TopLevelFlag"><span class="hs-identifier hs-type">TopLevelFlag</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcRef"><span class="hs-identifier hs-type">TcRef</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-type">PendingRnSplice</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#TcM"><span class="hs-identifier hs-type">TcM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-880"></span><span id="check_cross_stage_lifting"><span class="annot"><span class="annottext">check_cross_stage_lifting :: TopLevelFlag
-&gt; Name
-&gt; IORef [PendingRnSplice]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Rename.Splice.html#check_cross_stage_lifting"><span class="hs-identifier hs-var hs-var">check_cross_stage_lifting</span></a></span></span><span> </span><span id="local-6989586621681126943"><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681126943"><span class="hs-identifier hs-var">top_lvl</span></a></span></span><span> </span><span id="local-6989586621681126942"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126942"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681126941"><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681126941"><span class="hs-identifier hs-var">ps_var</span></a></span></span><span>
</span><span id="line-881"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">TopLevelFlag -&gt; Bool
</span><a href="GHC.Types.Basic.html#isTopLevel"><span class="hs-identifier hs-var">isTopLevel</span></a></span><span> </span><span class="annot"><span class="annottext">TopLevelFlag
</span><a href="#local-6989586621681126943"><span class="hs-identifier hs-var">top_lvl</span></a></span><span>
</span><span id="line-882"></span><span>        </span><span class="hs-comment">-- Top-level identifiers in this module,</span><span>
</span><span id="line-883"></span><span>        </span><span class="hs-comment">-- (which have External Names)</span><span>
</span><span id="line-884"></span><span>        </span><span class="hs-comment">-- are just like the imported case:</span><span>
</span><span id="line-885"></span><span>        </span><span class="hs-comment">-- no need for the 'lifting' treatment</span><span>
</span><span id="line-886"></span><span>        </span><span class="hs-comment">-- E.g.  this is fine:</span><span>
</span><span id="line-887"></span><span>        </span><span class="hs-comment">--   f x = x</span><span>
</span><span id="line-888"></span><span>        </span><span class="hs-comment">--   g y = [| f 3 |]</span><span>
</span><span id="line-889"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
-&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Bool
</span><a href="GHC.Types.Name.html#isExternalName"><span class="hs-identifier hs-var">isExternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126942"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#keepAlive"><span class="hs-identifier hs-var">keepAlive</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126942"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-890"></span><span>    </span><span class="hs-comment">-- See Note [Keeping things alive for Template Haskell]</span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-893"></span><span>  </span><span class="hs-glyph">=</span><span>     </span><span class="hs-comment">-- Nested identifiers, such as 'x' in</span><span>
</span><span id="line-894"></span><span>        </span><span class="hs-comment">-- E.g. \x -&gt; [| h x |]</span><span>
</span><span id="line-895"></span><span>        </span><span class="hs-comment">-- We must behave as if the reference to x was</span><span>
</span><span id="line-896"></span><span>        </span><span class="hs-comment">--      h $(lift x)</span><span>
</span><span id="line-897"></span><span>        </span><span class="hs-comment">-- We use 'x' itself as the SplicePointName, used by</span><span>
</span><span id="line-898"></span><span>        </span><span class="hs-comment">-- the desugarer to stitch it all back together.</span><span>
</span><span id="line-899"></span><span>        </span><span class="hs-comment">-- If 'x' occurs many times we may get many identical</span><span>
</span><span id="line-900"></span><span>        </span><span class="hs-comment">-- bindings of the same SplicePointName, but that doesn't</span><span>
</span><span id="line-901"></span><span>        </span><span class="hs-comment">-- matter, although it's a mite untidy.</span><span>
</span><span id="line-902"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">String -&gt; MsgDoc -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
</span><a href="GHC.Tc.Utils.Monad.html#traceRn"><span class="hs-identifier hs-var">traceRn</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;checkCrossStageLifting&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; MsgDoc
forall a. Outputable a =&gt; a -&gt; MsgDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126942"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-903"></span><span>
</span><span id="line-904"></span><span>          </span><span class="hs-comment">-- Construct the (lift x) expression</span><span>
</span><span id="line-905"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681126940"><span class="annot"><span class="annottext">lift_expr :: LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681126940"><span class="hs-identifier hs-var hs-var">lift_expr</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
-&gt; LHsExpr (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall (id :: Pass).
IsPass id =&gt;
LHsExpr (GhcPass id)
-&gt; LHsExpr (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsApp"><span class="hs-identifier hs-var">nlHsApp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="GHC.Builtin.Names.TH.html#liftName"><span class="hs-identifier hs-var">liftName</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdP (GhcPass 'Renamed) -&gt; LHsExpr (GhcPass 'Renamed)
forall (id :: Pass). IdP (GhcPass id) -&gt; LHsExpr (GhcPass id)
</span><a href="GHC.Hs.Utils.html#nlHsVar"><span class="hs-identifier hs-var">nlHsVar</span></a></span><span> </span><span class="annot"><span class="annottext">Name
IdP (GhcPass 'Renamed)
</span><a href="#local-6989586621681126942"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-906"></span><span>              </span><span id="local-6989586621681126937"><span class="annot"><span class="annottext">pend_splice :: PendingRnSplice
</span><a href="#local-6989586621681126937"><span class="hs-identifier hs-var hs-var">pend_splice</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
-&gt; Name -&gt; LHsExpr (GhcPass 'Renamed) -&gt; PendingRnSplice
</span><a href="GHC.Hs.Expr.html#PendingRnSplice"><span class="hs-identifier hs-var">PendingRnSplice</span></a></span><span> </span><span class="annot"><span class="annottext">UntypedSpliceFlavour
</span><a href="GHC.Hs.Expr.html#UntypedExpSplice"><span class="hs-identifier hs-var">UntypedExpSplice</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681126942"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr (GhcPass 'Renamed)
</span><a href="#local-6989586621681126940"><span class="hs-identifier hs-var">lift_expr</span></a></span><span>
</span><span id="line-907"></span><span>
</span><span id="line-908"></span><span>          </span><span class="hs-comment">-- Update the pending splices</span><span>
</span><span id="line-909"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681126936"><span class="annot"><span class="annottext">[PendingRnSplice]
</span><a href="#local-6989586621681126936"><span class="hs-identifier hs-var">ps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
-&gt; IOEnv (Env TcGblEnv TcLclEnv) [PendingRnSplice]
forall a env. IORef a -&gt; IOEnv env a
</span><a href="GHC.Data.IOEnv.html#readMutVar"><span class="hs-identifier hs-var">readMutVar</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681126941"><span class="hs-identifier hs-var">ps_var</span></a></span><span>
</span><span id="line-910"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
-&gt; [PendingRnSplice] -&gt; IOEnv (Env TcGblEnv TcLclEnv) ()
forall a env. IORef a -&gt; a -&gt; IOEnv env ()
</span><a href="GHC.Data.IOEnv.html#writeMutVar"><span class="hs-identifier hs-var">writeMutVar</span></a></span><span> </span><span class="annot"><span class="annottext">IORef [PendingRnSplice]
</span><a href="#local-6989586621681126941"><span class="hs-identifier hs-var">ps_var</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PendingRnSplice
</span><a href="#local-6989586621681126937"><span class="hs-identifier hs-var">pend_splice</span></a></span><span> </span><span class="annot"><span class="annottext">PendingRnSplice -&gt; [PendingRnSplice] -&gt; [PendingRnSplice]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[PendingRnSplice]
</span><a href="#local-6989586621681126936"><span class="hs-identifier hs-var">ps</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-911"></span><span>
</span><span id="line-912"></span><span class="hs-comment">{-
Note [Keeping things alive for Template Haskell]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
  f x = x+1
  g y = [| f 3 |]

Here 'f' is referred to from inside the bracket, which turns into data
and mentions only f's *name*, not 'f' itself. So we need some other
way to keep 'f' alive, lest it get dropped as dead code.  That's what
keepAlive does. It puts it in the keep-alive set, which subsequently
ensures that 'f' stays as a top level binding.

This must be done by the renamer, not the type checker (as of old),
because the type checker doesn't typecheck the body of untyped
brackets (#8540).

A thing can have a bind_lvl of outerLevel, but have an internal name:
   foo = [d| op = 3
             bop = op + 1 |]
Here the bind_lvl of 'op' is (bogusly) outerLevel, even though it is
bound inside a bracket.  That is because we don't even record
binding levels for top-level things; the binding levels are in the
LocalRdrEnv.

So the occurrence of 'op' in the rhs of 'bop' looks a bit like a
cross-stage thing, but it isn't really.  And in fact we never need
to do anything here for top-level bound things, so all is fine, if
a bit hacky.

For these chaps (which have Internal Names) we don't want to put
them in the keep-alive set.

Note [Quoting names]
~~~~~~~~~~~~~~~~~~~~
A quoted name 'n is a bit like a quoted expression [| n |], except that we
have no cross-stage lifting (c.f. GHC.Tc.Gen.Expr.thBrackId).  So, after incrementing
the use-level to account for the brackets, the cases are:

        bind &gt; use                      Error
        bind = use+1                    OK
        bind &lt; use
                Imported things         OK
                Top-level things        OK
                Non-top-level           Error

where 'use' is the binding level of the 'n quote. (So inside the implied
bracket the level would be use+1.)

Examples:

  f 'map        -- OK; also for top-level defns of this module

  \x. f 'x      -- Not ok (bind = 1, use = 1)
                -- (whereas \x. f [| x |] might have been ok, by
                --                               cross-stage lifting

  \y. [| \x. $(f 'y) |] -- Not ok (bind =1, use = 1)

  [| \x. $(f 'x) |]     -- OK (bind = 2, use = 1)
-}</span><span>
</span><span id="line-973"></span></pre></body></html>